Just to throw my 2c on the pile:
It was obviously a dog whistle to the white supremecist crowd, Elon has been playing this game for a good long while now.
I obviously cannot know what's in his mind, but part of me legitimately thinks he's just doing it out of pure personal spectacle and entertainment. Dude is the richest guy on earth, how do you get your jollies off then? For Elon it's being a massive raging douche, manipulating idiots, arguing in bad faith when called out, etc etc etc.
He's obviously not a morally centered person based on what we know about him, so if him getting his rocks off ends up in people getting hurt, I seriously doubt he would actually care.