The major wars of the 20th century have certain things in common with the .COM boom and the so called 'space race', but are not comparable, in the same respect, to more historical armed conflicts - examples being the Gallic wars of Julius Caesar or, for example, the War of 1812.
The opening question is: what's the difference between building a house and launching a Mars expedition? When one builds a house, much of the infrastructure for construction and materials production is already in place: one has wood, concrete, plumbing, wiring, and appliances available at one's fingertips. The contractors are standing by with bulldozers, concrete trucks, nail guns, and pipe benders.
In comparison, the Mars expedition incurs a huge amount of trial and error improvisation all along the supply chain - one is building a lander, on-planet housing, water purification, food production technology, launch facilities, instrumentation, and so forth. Therefore one has to build infrastructure to build infrastructure. When one observes the progression of the US space program, one sees vast amounts of innovation in electronics, materials, life support, computation, facilities construction, 'food engineering', and so forth. The .COM boom required the production of vast quantities of routers, fiber, servers, network software, browser software, email servers, etc. These put an inordinate demand on the entire global workforce.
What one sees in WW I is innovation in submarines, aircraft, diesel engines, airships, and tanks, and in WW II innovation in nuclear physics, electronics, aircraft, submarines, radar, and codebreaking. This was not merely 'putting a lot of people to work' in factories, as well as on the front, it also demanded all out effort from academics, scientists, engineers, and designers. The distances involved, particularly in the Pacific theater, demanded a lot of work just to ship things around. Someone growing corn and raising chickens wasn't merely feeding troops, but merchant seamen, transport pilots, road builders, truck builders, and so forth.
WW II was a vast waste of human potential and treasure, however what was left over contributed significantly to the economic boom of the 1950s. One can see at least three influences: the first is the production resources created during the war, the second is the new technologies, and the third is the workforce that had learned how to make and operate all this new stuff.
Much of WW II was fought over enormous distances, and in certain respects this meant that a lot of the war effort was logistical rather than belligerent. The United States had to maintain supply lines to Britain, Australia, the Philippines, and China at various stages of the war, including transportation by sea and air. At the end of the war, much of this was immediately pressed into civilian service.