Judge McCormick said the pay package would have been the largest ever for the boss of a listed company.
Tesla failed to prove the pay package, which dates back to 2018, was fair, she said.
A shareholder vote on the payment passed by 75% in June, but the judge did not agree the pay should be so large despite what she called Tesla’s lawyers’ “creative” arguments.
“Even if a stockholder vote could have a ratifying effect, it could not do so here,” she wrote in her opinion.
The judge also ruled the Tesla shareholder who brought the case against Tesla and Mr Musk should receive $345mn in fees but not the $5.6bn in Tesla shares they asked for.
Some observers said a ruling in favor of Musk and Tesla would have dealt a blow to conflict of interest laws in Delaware.
“The idea of conflict rules is to protect all investors” not just minority investors, said Charles Elson of the University of Delaware’s Weinberg Center for Corporate Governance.
Mr Elson said McCormick’s opinion was well-reasoned.
“You had a board that wasn’t independent, a process that was dominated by the CEO, and a package that was way out of any sort of reasonable bounds,” he said. “It’s quite a combo.”
Tesla is expected to appeal the decision.