Ingratiating himself with Trump, I imagine. It certainly paid off in the short term, since he was given a golden ticket to sack the government.
A lot of tech execs successfully brown-nosed Trump, which (unfortunately) is understandable to some extent given what was at stake with his tariffs and other assorted threats. But Musk is the only one who evidently enjoyed it.
I personally think he really is a fascist, but I still don't think he was deliberately throwing out a Nazi salute. Just naive about waving to a crowd in front of a camera, which is very on-brand for him.
He's naïve about many things but I don't believe any of these people are ignorant of fascist imagery or its trollish power, even if only in some bullshit recycled bad-sci-fi trope sense.
He may be more ignorant than he portrays but he is a malignant narcissist — guys like him don't even think fascism is a bad idea.