“Global problems need global answers.”
Nationalism was very important for human civilizations to create stable countries, and to protect themselves from foreigners. It still plays an important role today. If people did not feel belonging to a nation, there would be more chaos and unstable structures. Countries that have strong nationalistic bonds have more prosperity, such as Germany or Switzerland. Countries that don’t have such strong, nationalistic feelings don’t prosper as well (i.e. Afghanistan or the Congo).
There are also big dangers with nations. Nuclear war is a great example of this, especially when one nation wants to protect itself from another.
Also, countries compete with each other in other areas, not just in the area of the military. Generally, this competition is good because it drives technological progress, but it may lead to irreversible changes. Like climate change.
For humans, the best way to survive is to live in our tribes (countries) but to cooperate with the global community to solve our problems together.