I'm not disputing that things come out of war, it's just not an especially great ROI.
The medical advances of military spending alone are breathtaking.
There is still a gigantic opportunity cost of bringing together resources to produce an explosion rather then something more useful.
The old 'its going back into the economy' is some sneaky Keynsian language that only applies in certain macro economic situation and even that was mostly wrong and a misunderstanding of economic theory in the late 30s.
You can fund medical research without spending a million dollars sending a man to a desert, having his legs blown off, and flying him home. Hell, the US especially could actually use that research on civilians without bankrupting them!
And what about rebuilding bombed out cities? Is there so little else to improve?
It’s also a sociological trick. Societies support massive military R&D in ways that are impossible for public projects. We could wish upon a star that humans weren’t as we are. Or we can work with reality.
Military innovation is also historically a jobs program.
Check out how many states & companies are part of R&D/Manufacturing for the F-35.
ARPANET was military in origin, but "the Internet" happened at CERN, a civilian project.
The ROI on CERN then, is astronomical, as it only cost a few billion. Less than a month of a war in a desert that achieved...what?
And if ARPANET hadn't happened (because the US wasn't worried about having a chunk of comms destroyed in a nuclear war), the NPL in the UK was also working on packet switching networking in the 60s, and that was a civilian-industrial thing. So something roughly Internet-shaped would probably have happened anyway.
While on the subject of the NPL, they also developed the first atomic clock. So then GPS also has a non-military underpinning.
The web happened at CERN, not the internet.