As horrible as war can be, there are some benefits that it provides. Generally speaking, a war provides an economic boost to the countries at war. Research and manufacturing are typically ramped up, jobs are provided, and the economy experiences a boom of sorts. Science and technology industries see benefits of war as well, because they are trying to find and produce items that will give an army battlefield advantages.
If you look at WWII, war ended Hitler's threat of world domination. It also ended his attempted genocide of the Jews.
Wars can also provide the benefit of providing a country with more land and more land resources. Of course that's a double edged sword though. What one country is gaining, the other is losing.
War also tends to unify a country behind a single purpose. There is often a rise in patriotism and support for the government and the armed services.