Pennsylvania Judge Angelo Foglietta's decision came after a surprising day of testimony in Philadelphia state court in which Musk's aides acknowledged hand-picking the winners of the contest based on who would be the best spokespeople for his super PAC's agenda, despite the billionaire's assertion that they would be chosen randomly.
Tesla CEO Musk has already given away $US16 million ($A24 million) to registered swing state voters who qualified for the giveaway by signing his political petition.
His group, America PAC, announced a winner from Arizona on Monday and said the final winner, from Michigan, would be announced on election day on Tuesday.
America PAC launched the contest on October 19.
It is open to registered voters in seven key battleground states - Arizona, Georgia, Michigan, Nevada, North Carolina, Pennsylvania and Wisconsin - who sign a petition pledging to support free speech and gun rights.
Philadelphia District Attorney Larry Krasner, a Democrat, on October 28, sued to block the contest in Pennsylvania, alleging the payouts amounted to an illegal lottery with hazily defined rules.
Foglietta denied Krasner's bid in a brief written order on Monday and said he would lay out his reasoning later.
Musk became an outspoken Trump supporter this year and has promoted the former president on his X social media platform.
He has so far given nearly $US 120 million to America PAC to promote its voter mobilisation and registration efforts, according to federal disclosures.