I agree that the US military has made positive contributions to the world, but I don't think it's the main source of the Pax Americana -- strong international bodies (NATO, UN, &c), the tendency for democratic nations (the dominant sort in the 20th century) to avoid wars with each other, and advancements in crop science are all individually more responsible for the relative global stability of the last 30 years.
I don't deny that the military had a role (usually financial) in any or all of the above, but I wouldn't call it a causal role: virtually all academic research funding hits the defense world eventually ("food security", "ecological security", &c), especially during the Cold War. That's the result of political contrivances, not any sort of deep connection between the U.S. military and scientific progress.
Finally, I wonder about drawing comparisons between the past U.S. military and current ventures. The Google engineers in question probably wouldn't be designing waterproof radios for fastboats; they'd be training models that "recognize" "terrorists" from afar and systems that pass that information to drones for remote killing. Put another way: the shift away from conventional warfare changes the moral dimensions of working for the military.