Don’t they need security clearances to do this?
They do. Elon already had top secret due to NASA/military work. The rest were authorised/given clearance for the work.
Who says they don't have them? Elon Musk certainly does.
King Trump says they dont.
Legally, probably. But in the US, "legally" is enforced by the executive, and that's who's telling them to comply.