About war: in our universe we got the first digital computers because of military efforts during the second world war. However, without a war IBM and Konrad Zuse and others would have gotten there, too. With much less human suffering.
Most US investment in associated tech - including the Internet - came through DARPA.
Not pointing this out because I support war, but to underline that the US doesn't have a culture of aggressive government investment in non-military R&D.
NASA and the NSF both get pocket money in budget terms. And at its height Apollo was a Cold War PR battle with the USSR that happened to funnel a lot of of money to defence contractors.
The original moon landings were not primarily motivated by science.
Private sector doesn't do much without obvious short-term gain, and it especially doesn't do basic research. It may be good at fitting more pixels in ever thinner phones, but it wouldn't get to that point if not the government that needed number-crunching machines for better modelling of nuclear fission some 80 years earlier.
So I think the opposite: we are way past the point of space exploration being directly useful for weapons.
Just don't spend tax payer money.
(And, if you don't like the monetary framing: just look at the real resources spend instead.)
However I'm not nearly as harsh on unmanned space exploration.
A rocket scientist/engineer/technician/etc at NASA is not going to work on the thing we "should" spend money on instead if tomorrow you shut down NASA's manned spaceflight programs. They'll probably go work on ads at Meta instead.
> They'll probably go work on ads at Meta instead.
And provide value there, yes! That's how the economy works.
> That's not how resources work. Resources that are used for space exploration aren't magically available for anything else when you don't do space exploration. The economy is not a zero sum game and human capital is not fungible.
Your 'Meta' example was about fungible human capital, wasn't it? In any case, human capital is fairly fungible in the long run: people won't train on the skills necessary to hurl primates into space, if they know that there's no manned space programme in the first place.
And to make my position sharper:
NASA and the world would be better off shutting down their manned space programme tomorrow. A lot of the skills and human capital (but not all!) involved there can be funged into unmanned space exploration.
1) It's better aligned with mission profile (inspirational, emotional, but not strictly necessary;
2) There's much more of it to go than NASA gets;
3) It would be a better use of that money than what it's currently used for.
We'd get more and better science by spending it on unmanned space stuff. Or you could even just leave the money with the taxpayer.