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.