Right, but it's not exactly "non-productive", from the article:
> One way in which defence spending might be said to boost the economy is as a jobs programme. [...]
> Defence spending may deliver better returns as an undeclared form of industrial policy. [...] On average, they found that a 10% increase in government-financed R&D leads to a 5% increase in privately financed R&D in the targeted firm or industry. Moreover, there are knock-on benefits for productivity.
And yes, it's true the military research provides benefits and applications outside the military, (GPS for instance), but if your goal is R&D, it's far more efficient to invest in R&D for R&D's sake, not retroactively justify massive military excess because of knock-on effects.
We spent two trillion dollars in Afghanistan. Imagine what that could have done for our country's energy and transportation infrastructure.
You cannot examine the what the world would look like if there was no military spending; that's a counterfactual. But we know from essential economic science that spending money on non-productive activity does not serve to increase the general economic welfare. In the US alone there are 2 million people serving in the military. Many are endlessly training for a war that most likely will never take place, others are glorified janitors, and the rest are in administration running the training and janitorial work. Imagine if the labor productivity of 2 million people were put to better use. Building houses and products and services that we all need and enjoy rather than mucking about in a field somewhere with $12000 of equipment on their back. (The division of labor is a major argument in economic circles against mandatory conscription)
Of course, militaries are important. The events in Ukraine prove this. But I don't think there is any point in trying to argue that they are good or irrelevant to the economy.