From The Planetary Society: "None of NASA's budget is used for national defense or intelligence gathering programs; it is a civilian agency responsible for the peaceful exploration of space"
Do you have evidence to the contrary you could share?
GP is hyperbolic but essentially correct. Generally, states will move as much as science and technology research that is not militarily sensitive to the public sphere - such as NASA. This is because many scientists won't work for the military directly [1], but will work on stuff that has both military and non-military applications. This science is then used by the military for their purposes.
Many people have also written quite a lot about how the race to the moon was primarily funded because it was a military domination competition. Once the USSR decisively lost, the US stopped doing that expensive science. A good overview of the geopolitics of space exploration and research is the book Dark Skies by Daniel Deudney [2].
[1] Combination of ethical reasons and having to do security checks and your freedoms somewhat restricted.
Do you have evidence to the contrary you could share?
https://www.planetary.org/space-policy/nasa-budget#:~:text=N....