The Space Race was a unique and limited phase coming out of the atomic age when public support for scientific research was at an all time high. With the Kennedy and Johnson administrations willing to fund programs left and right to improve education and research with long term aims. The Soviets were also at the apogee of their scientific capability, and Khrushchev did great PR for all their achievements which unnerved Americans and provided the Cold War justification for new domestic programs.
Once the Brezhnev age of stagnation and lopsided USSR military spending set in, the new Cold War 2.0 became about numbers of delivery vehicles and NATO conventional deterrence, not space and science. By then the US had clear technological dominance that seemed insurmountable in the new world of microchips and computers in which the Soviets couldn't compete. Which allowed Reagan to boost military budgets and deficit spending while simultaneously beginning the Republican "starve the beast" strategy to cut taxes and non-military domestic programs.
All of this is to point out that Cold War = Space Race/Apollo is looking back with rose colored glasses. We could just as easily see federal space and science spending getting further slashed every year while churning out warheads, delivery vehicles and conventional arms ever faster (and seems more likely based on late Cold War trends).