The wars itself destroy wealth. You draft huge percentages of your population go to off and kill and die, your roads, farms, and industry being wiped out in the process until one side quits. Both WW1 and WW2 devastated Europe, France and Russia/USSR specifically. Millions died, Billions or even Trillions of US dollars were spent on things whose only economic product is survival.
HOWEVER!
What gets left out of the equation is the following:
First 1) The investment in stuff that kills people can be transferred to things that make money. World War 1 saw Naval and Aeronautic developments. World War 2 saw Radar, Electronics, Plastics, Nuclear Energy, Chemical understanding, Medical Understanding. All that money to build weapons and put people back together leads private sector, or civilian (depending on your economic setup) applications that would have been developed later on.
Second 2) Mass killing of population has an economic development side effect. Anyone remember that the Black Death killed Serfdom in europe? The serfs could demand more rights, more power, lower taxes, because they were now in demand. They gained rights. But that is a side effect. This population die off also forces mechanization. Wind Mills begin to develop at this time. So, You are France, you have lost millions of guys killing the Germans. Who the hell is going to work in your fields and factories? I know! Ill use this money that we extorted, i mean "won" from the Germans, and upgrade my factories and farms. Now we produce nearly as much with fewer guys. Our per-capita output is going up.
So, The wars wipe out lots of manpower and resources, however fighting these wars forced technological and economic innovation that had a positive effect.
As I sit here, typing this on a Plastic keyboard, using an electronic computer, connected with a wireless internet system to an Internet itself, eating a tuna sandwich from which the tuna came in a can, and so did the condiments, drinking a soda also in a can, all these things were developed for big wars.
Would we have these technologies without the wars? maybe, but not nearly as soon as we had them now.
The thing is that private business creates things for customers. They have to guess what people want and then make things. When a big war happens the Government demands things, and they are a huge customer, who often throws around stupid amounts of cash. Sure there is huge waste involved, but it gets stuff done.