Of course it is. One might have been able to argue that between 1958 and 1984 there were constitutional problems with it, but since 1984 certainly not.
Congress is empowered by the Constitution to provide for national defense.
What happened in 1984? Star Wars? Even there a lot of what NASA does isn’t national defense related.
One might argue that? The National Aeronautics and Space Act not only had "constitutional problems (euphamisms like that make you sound like a lawyer)...it was (and still is) unconstitutional
The Act's Declaration of Policy and Purpose makes clear it has nothing to do with national defense...it carves out defense applications of space research and makes clear that those will remain with the Department of Defense. No...the Act specifically cites the "general welfare" clause as its authority...you remember that clause...the one FDR cited for several of his New Deal intiatives (that Constitution was a real impediment to FDR's socialist policies)...an argument Madison cited as an absurd misconstruction of the Constitution
Ahhh...but, by the time NASA was enacted in 1958, the federal government was long past caring about Constitutional limits on its powers
Wrong agency. DoD and other un-named agencies have military space assets for both offensive and defensive, not NASA. You have obviously not read their mission statement:
To advance and communicate scientific knowledge and understanding of the earth, the solar system, and the universe.
To advance human exploration, use, and development of space.
To research, develop, verify, and transfer advanced aeronautics and space technologies.