The Pennsylvania judge ruled after Musk’s lawyers said in court the winners are paid spokespeople and not chosen by chance, and defended the effort as political speech.