There were plenty of explanations from the White House why Tesla wasn't invited: because it was an UAW event. Tesla is notoriously anti-union and its employees are not represented by the UAW.
What led you to belive it wasnt about the UAW? just the name of the event?
Not that it matters anymore as Trump undid all of that, so there's no longer a pledge to switch to EVs, nor is there any sort of federal tax credit for purchasing EVs (technically there still is, but only until September).
I'm sure this is a much better deal for Musk overall than not being invited to an event.