Elon Musk said he felt "foolish" for spending nearly $500 million on the midterm elections after Republicans' poor performance.