I think Musk has given up on Tesla. He should have hired a real CEO years ago. At the moment, Tesla is a wreck. Its cars have major quality issues these days; there's no innovation going on, other than their idiotic non-functional self-driving features. The only reason Musk is still there, I suspect, is that the stock would crater upon his departure, because the stock market has gotten really stupid.
So Musk supports Trump, who will give him the tariffs his business needs to survive. Sure, he won't sell much in China these days, but they already weren't selling much in China because the Chinese make better cars for 1/3 the price. The only market where Tesla is a leader is the US market, and that's not going to last forever.
The other factor is that Musk seems increasingly infatuated with his space business. As I understand it, SpaceX was his real love. Tesla was the day job, so to speak, to finance SpaceX. Remember: Musk loves his companies to be on the public dole, racking up subsidies they don't need or are even eligible for without cheating. And if that's your goal, Trump is your guy.
Finally, Musk does seem like a drug addict. His judgment is truly impaired. He seems to have gotten red pilled almost by mistake. I mean, does the guy who brought you the Cybertruck seem like a guy who is responsibly managing a business?