Jefferson commissioned the Corps of Discovery for the Lewis & Clark expedition, whose "objectives were scientific and commercial."
If our spaceflight program was as part of the military, with NASA was overseen by DoD, it would be equivalent to the Corps of Discovery.
It was originally overseen by military. Eisenhower felt it looked better to the world PR-wise if it was civilian managed. Still only up until the last 30 years there was still a lot of military involvement. For example they didn’t recruit the astronauts from Sears.
The preamble talks about providing for the common defence. How can we defend ourselves against a possible attack from Pluto if we don't explore the place?
NASA's remit wasn't tied to military endeavors, thus breaking whatever Constitutional linkage to NACA that NASA may have had. That's my armchair legal ruling.