You are confusing yourself.
It is not legal on the federal level in any state, and anyone who does partake, even in a "legal" state is deemed a Prohibited Person and is ineligible to buy, own, or even touch any firearm or ammunition.
Musk was in hot water for a time after his stunt with his federal SpaceX contracts and his own federal security clearance.
Until the federal laws are changed (and I hope they are - they are stupid laws) you are fooling yourself that you are legal.
When is the last time you saw the federal government prosecute anyone for use of marijuana in states where it's legal? Even in DC itself where it's legal?
“Marijuana is legal for adults in 18 states and Washington, D.C. Medical marijuana is legal in 37.
Not to mention smoking marijuana has never been the sign of a pervert, even before marijuana was legalized in DC and 18 other states.
Yet Musk and SpaceX just keep winning the NASA contracts, despite the massive efforts by Blue Origin and Bezos to stop them, including repeatedly taking legal action to stop the SpaceX contracts for the NASA Lunar Lander.
As of right now, Musk/SpaceX are the only outfit that can send humans to the space station, outside Russia. Without Musk, it's back to the Russians to beg them to take American astronauts to the space station again, like they did for 9 years after the Space Shuttle program was ended.