Is war never justified or is war necessary to have in the world?
This is, of course, a matter of personal opinion. There is no way to objectively determine the answer to a question like this. My own view is that war is necessary, but only because some people go to war without justification. War is necessary because people have to defend themselves against others.
There is no real reason that it would be necessary to have war in a perfect world. If people were not greedy and hateful, there would be no need for war. War, in and of itself, does not serve any good purpose.
The problem is that people do things that make war necessary. People see that their neighbors have resources and they want to take those resources. People come to believe that their group is superior to other groups and they try to subjugate those other groups. In order to prevent this, it is necessary to go to war at times. As an example of this, we should simply think of World War II. There was no need for that war to start. However, once Hitler started the war out of his greed for power and his hatred of groups he thought were inferior to the “Aryans,” war became necessary. It was necessary to resist Hitler to prevent him from dominating all of Europe.
Ideally, we would have no war. However, war is sometimes necessary because human beings tend to try to take things from others by force.
There is an old adage: "If the only tool you have is a hammer, everything starts to look like a nail." War is a "hammer," when nations do not have negotiation, treaties, mutual benefits, ego-less win-win possibilities, etc. in their toolkit. It could be argued that so-called "human nature" (read "the ten deadly sins") will always result in eventual conflict, and that the "food chain" theory of statehood will always prevail, but those concepts are "Western" ideas; if we look at "Eastern" philosophies such as Buddhism or Taoism or even Confucianism, we can envision a "maturing" of the human species past the confrontational to the spiritual/universal view of human existence. So, until then, yes, war is inevitable, but after then, not so much.