Since the earliest days of recorded human history, wars have been fought for various reasons. Are they always necessary? Absolutely not. But a utopian world where war is non-existent is probably a pipedream. Some wars seem necessary to achieve the goals intended by one of the differing sides. Using the present-day situation in the Middle East as an example, I find the United States' intervention in Afghanistan to be a logical response to the terrorism that threatened our country. However, our second invasion of Iraq was not advisable and certainly avoidable. Since our specific reason to invade was because President Bush assured Americans that Saddam Hussein was producing weapons of mass destruction, it proved to be a costly mistake. No WMDs were found, nor was there any true evidence that there had ever been any WMDs produced. In this case, it seems that our President not only deceived the American people, but used our nation's military to settle an old grudge. (Saddam had once issued a bounty on the first President Bush, and his son was quoted--in private--on several occasions that he would eventually get back at Saddam.) Of course, many wars have been started for far less important or logical reasons, and nations will continue to do so in the future.
It is never necessary to start a war, but it is often necessary to participate in a war once some other country has started the war.
Let us look, for example, at World War II. From the point of view of the US and the Allies, this was a necessary war. They had to fight for survival (France, Britain, USSR) or at least for the protection of parts of their territory (the US). This was not really optional.
However, the instigators of the war did not have to start it. The Germans and the Japanese had grievances, some legitimate, some not. But even so, it was not absolutely necessary for them to try to solve those grievances through war. Those things could have been worked out diplomatically instead.
So, countries often have to fight back, but I cannot think of any war where the aggressor actually needed to attack the other country.