This is an interesting question, but too broad for this site. I will take this article as a reference for some arguably good effects of some wars (World Wars):
The First World War destroyed empires, created numerous new
nation-states, encouraged independence movements in Europe’s
colonies, forced the United States to become a world power and led
directly to Soviet communism and the rise of Hitler.
The difference was that the second major internecine war in Europe in
a generation led to a profound change in political thinking, at least
in Western Europe, about how states should conduct their relations.
What is incontestable, however, is the number of advances in science,
technology and medicine, as well as the revolutionary changes in
social behaviour that occurred as a result of the 1914-18 conflict.
The aristocracy was overthrown or its role greatly diminished. The
socialist and labour movements seized the opportunity to make
Going back to Napoleonic wars, the first answer here enumerates some of arguably benefits of Napoleonic wars:
- German speakers were consolidated in a few big states
- Italian speaking peoples found themselves under one government
- creation of the modern, federal 'state'
- the sharing of power between reactionary aristocrats and the up-and-coming industrialists
There are many other examples of possible benefits of a war and one can write an entire book about it.