The missile gap for example after all was settled and done, didn't matter at all because not a single missile was ever fired off. All that money, resources, talent, secrecy, lives lost maintaining that secrecy, lives dedicated to furthering that technology and secrecy, it just has not paid off at all for anything at all when you think about it. Maybe you can argue side efforts like nuclear reactor were great or space cargo deployment, but you know you could have just dug into that stuff directly without having to collect it from the drippings of the wmd effort.
It is not clear to me that the nuclear missile race "has not paid off at all for anything at all". If we lived in a perfectly rational world, then I'd absolutely agree. However, having seen how the political sausage is made in large organizations, it would not surprise me in the least if it turns out we had to go through that entire incredibly risky journey to avoid a strategic nuclear war. Sometimes leaders of large organizations make decisions only after the considerations are put into very stark terms. I wish it were different, it certainly looks to me we could have done exactly what you suggest, but I'm not made of the right political stuff to deftly maneuver even in small organizations much less be at that level in those roles, so maybe I'm just missing relevant information and perspective.