I think the Scott Adams piece the other day[0] described the system dynamics well:
"Once you’re sufficiently prominent, politics becomes a separating equilibrium; if you lean even slightly to one side, the other will pile on you so massively and traumatically that it will force you into their opponents’ open arms just for a shred of psychological security."
I think Biden giving credit to GM[1] and being used as a political football, prior to Musk entering politics in a big way himself, drove him away from the left and (by process of elimination) toward the right. Once you're down the rabbit hole, the rest is history.
[0] https://news.ycombinator.com/item?id=46646475
[1] https://www.businessinsider.com/gm-ceo-joe-biden-elon-musk-t...