Musk hates regulation and government oversight. You saw that during COVID where California rules required his factories to shut down. You also see it with SpaceX where they push back hard on regulations (justifiably in many cases). He was left leaning because they were more supportive of EVs, but otherwise he has always been happier with small-government extreme capitalism models.
He also had a bit of a meltdown because of his Trans daughter. That was probably the trigger for him going political and buying Twitter.