Patriotism, that is, standing up for good values embodied in your country or homeland, and generally feeling good about your country is anything from benign to good. Nationalism is the ugly backside of patriotism where, at best, it's benign, but very easily can turn to scapegoating or get violent. Not to bring up the Nazis, but, well, the Nazis.
It's understandable that people are wired to protect "their own" and to have an "us vs. them" mindset, but since we're rational human beings capable of higher thinking and we can learn from past mistakes and successes, we should be able to see that there is a great benefit to being open and accepting of people outside of "our own" and that marginalizing is dangerous.
Like, imagine if every country was all super nationalist. There'd be wars, most likely, but even without wars there would be other problems that could lead to wars. Competition over resources (like, for instance, fish) could wipe out that resource. Calls to limit the amount each county fishes would be ignored because you'd have a prisoner's dilemma situation. It would be in each country's interests to take as much as they can. Another thing that could happen is a pandemic. If one country collapsed or otherwise couldn't provide for its people, then no other country would and you would have a large, desperate population of people carrying disease which would eventually spread to other countries.
Cooperation is just the better option.