For a war to be supported by people (soldiers, and in democracies, civilians as well), they need to view the other side as the Other side. The Enemy. The Others.
Nationalism is about building a strong us/them split, about having people internalize clear categories of Our Nation and The Others. This directly facilitates war.