The problems with determining a cost-benefit ratio for a war are that there are far too many variables involved to be accounted for and measured, if, indeed, they can be measured. Anyone who says otherwise is fooling themselves. This is the reason that it is called the ART of War, not the SCIENCE of War.
History is full of examples of governments that fooled themselves into believing that, based on a notion that the benefits will outweigh the costs, launching a war would be a good idea. Once the war begins, the events never follow the course anticipated.
Of course there are any number of benefits that nations have gained through participating in a war. To take one of the most obvious examples, the economy of the United States benefited enormously from the nation's participation in World War II. The unemployment of the depression was virtually erased by the enormous demand for labor, skilled and otherwise, produced by an unprecedented war effort. The demand for vast quantities of goods of every imaginable kind - including ground breaking technology - created jobs for practically everyone in society, regardless of race or gender. The combination of the temporary halt to the production of civilian luxury goods - appliances, automobiles, even new housing - and the aggregate increase in income left individuals with little option but to save and invest, including buying War Bonds.
While the war effort had a similar effect on the economies of the other belligerents, it was the United States alone whose home front was not wrecked by invading armies and / or strategic bombing. Because of this distinction, U.S. businesses had an unprecedented advantage at the conclusion of the war. The industries and infrastructure of the other belligerents were, to one degree or another, badly damaged - entirely leveled in the case of Germany and Japan - while their financial circumstances had also suffered as a result of the war. Therefore, U.S. firms had little foreign competition immediately after the war. Simultaneously, domestic demand soared as hundreds of thousands of young men returned home, married, and chose to begin families, with all the material requirements that that entailed. The money that, during the war, had been saved for lack of consumer goods to purchase, was now free to be spent on all manner of items: appliances, automobiles, new homes, etc...
Reading this, one would quite understandably be persuaded to conclude that, on the whole, U.S. participation in World War II was beneficial to the nation.
But what about the path not taken? What would have been the future of the United States and the world had the more than one-hundred thousand young men from the United States who died fighting the war had, instead, been able to live out their lives? Who can say what their impact on humanity would have been? Who can say whether or not any one of them may have found the cure for cancer or developed a new form of energy?
What about the still unresolved consequences of the creation of nuclear weapons? It was the demands of the Second World War that led the United States to develop, at enormous expense, the first nuclear weapons. Of course, the possession of nuclear weapons by the United States inevitably led potentially rival nations to develop the technology to deploy their own nuclear weapons, a circumstance that to this day has placed the world under a nuclear sword of Damocles. Do the benefits accrued to the United States of participation in World War II outweigh the still existing possibility of all of humanity destroying itself?
This, therefore, is why determining the cost-benefit ratio of war is impossible to calculate.