In the case of the Vietnam War, the United States justified its involvement by claiming it was necessary to stop the spread of communism in Southeast Asia. However, this claim was highly controversial, and many people believed that the war was unnecessary and unjust.
Ultimately, the decision of whether or not a war is justified is a complex one that must be made on a case-by-case basis. There are no easy answers, and there is always the potential for unforeseen consequences. However, it is important to remember that war should always be the last resort, and every effort should be made to find a peaceful solution to any conflict.