When you place an objective like the Moon in front, at the least your research has to result in it getting closer. The hope is that this broad objective results in something as opposed to something narrower you might want.
The corresponding risk is in the resulting cargo cult around arbitrary constraints whose reasons were forgotten. I bet if we committed to building the Panama canal with only spoons we'd have ended up with a lot of amazingly useful spoon-platform earth moving technology, and the commercial sector would've ended up with highly optimized spoon-based machines, and it'd all be very stupid compared to what we got instead.
I really love the book "The decision to go to the moon" because it chronicles not apollo itself, but the years leading up to the decision to do it.
Remember: The soviets had just successfully launched sputnik and were years ahead of the US. It was perceived to be a matter of national security and pride, we had to do something.
The choices were:
1 - do it, but as a secret CIA/Pentagon thing focused on military power, objectives, run by the military leadership.
2 - Do it as it was done, as a civilian, public thing for us all to share in.
I, for one, am very grateful they chose 2.
I think its out of print. I had to buy it used on Amazon for like 80 bucks when I bought my copy.
People similarly laud military research, but it's not as if you need the military to carry it out. Governments were just willing to fund the research as part of a military effort.