I'm in agreement with everyone here. We had no reason for the Space Race but national pride and if we had lost to the Russians national pride would have built a moonbase just like it got us there. Hopefully, we'd lose there too and maybe be on Mars by now.
In certain cases government has a legitimate purpose in building infrastructure for which there is little use foreseeable. How much have we saved due to improved hurricane forecasts, the warnings of El NIno, GPS, satellite communications etc etc. (Not to mention computers as a spinoff) Even Arthur C. Clarke didn't foresee even half of these. How much more might be derived from permanent research on other planets.