The Eisenhower Paradox:
FRAME CHALLENGE: The idea that economic prosperity is contrary to good defense spending misses a critical detail. Defense spending requires a massive industrial base, a huge economy to support it, and an undamaged nation NOT devastated by war to build and maintain all the weapons involved.
Dwight D. Eisenhower knew when he became president that he could get the USA behind a program to build weapons to battle the USSR. But he elected instead to invest in the buildup of the US economy so the nation was more ready for supporting future military spending without bankrupting the rest of the economy.
The Soviet Union sought to build and maintain a huge war economy for decades, and even they knew they had to invest in industry to support it. But their constant spending on weapons production meant that the overall economy suffered as a result. Despite NOT fighting WW3 with the west, the Soviets kept their system together. The existential threat of Soviet invasion served as a pressure to keep the west invested in their military. Both sides benefited in terms of military preparedness by the constant posturing and numerous small wars that pushed innovation forward.
The massive spending on military technology could have probably created higher growth rates on its own, but there would likely have been less public investment in technology WITHOUT the constant threat of war. There were benefits from the technologies developed to support the military-industrial complex, which helped the development of technology throughout the nation. The interstate highway system was developed at least in part to allow movement of troops and evacuation of cities in the event of war.
So to ensure that the spending on the military keeps up without a break, you have the HUGE and well-understood not-so-existential threat of known periodic attacks. Spread the production of weapons, parts and power systems throughout your economy, and everyone will have some benefit from the continued spending. Efforts to reduce the impact of the battles and power consumption (overpowered power systems, huge "high speed" trains to move your mechs, duplicated industry in case of damage, agricultural stores to counteract devastated land) will all benefit from the massive infrastructure investments taken to prepare for these battles.
So the wealthy nation is the one that lavishly invests in being ready for war, yet doesn't overly fixate on the mere building of weapons. Because war requires an economy, not just a giant killer robot.