Billionaires are rarely aligned on any political spectrum. They pray at the altar of Mammon and they are aligned to whatever "side" promises the biggest financial upside.
Musk cosied up with Trump because he saw a way boost revenue with lucrative government contracts and a prez that is buyable wrt whatever other projects he has planned (Orion/Starship, Robotaxi etc)
He had a falling out with Trump when he realized that the winds were blowing in the opposite direction than anticipated.
Their only ideology is money, nothing else.