The whole basis of a nation is the creation of an in group and an out group.
Free association.
As the inscription on the Statue of Liberty says, "Give me your tired, your poor, your huddled masses yearning to breathe free".
It's variety of people, customs, cultures, and opinions which make for a healthy nation, not a monoculture of brainwashed xenophobes.
If this ever does happen, how might in-group favoritism and out-group hostility change on average? I think people voluntarily self-organizing based on their preferences and principles is definitely preferable to something arbitrary foisted upon you at birth, and of course tribalism will always exist in almost any situation, but there are some interesting trade-offs to think about here.
What are the odds a hypothetical future without nationalism leads to a form of tribalism that's riskier than nationalistic tribalism? People may feel a deeper identity connection to something they've actively joined for philosophical and sociological reasons, rather than due to their GPS coordinates or what their parents believe. There could be something like (cold or hot) religious wars, except with a ton of different religions forming and changing all the time, and based on differing principles and practices instead of differing supernatural beliefs.
I have found though that people like their country's customs and traditions a lot and are proud of the country their parents are from.
However it's true that based on how strongly held some political beliefs are, some people would identify more with those from another country with the same political beliefs than those in their own country. Same with religion. It's important then to have things they share in common so they can get along in day-to-day life whilst disagreeing about other things.
Diversity of thought and opinion is important, and I would argue thats its actually a good thing to have GPS coordinates determining a grouping, rather than letting people form groups with who they get along with best.
What is the optimal grouping of countries and politics is an interesting question to ponder. Lots of lessons can be learned from history on this such as how borders of countries were drawn during British colonialism and also after each World War.
The goal perhaps is to find the largest groups of people to put together whose political spectrums are not too wide that people can't get along with one another.
There is only one inscription on the Statue of Liberty, it reads "JULY IV MDCCLXXVI".
Why not go all the way, and add Russia to the mix? Do you foresee this being practical in the real world?
Which takes us back to my original comment on the OP's post, whom decry'ed nationalism as evil. And me saying that statement as being too simplistic a take on reality.
"the desire by a group of people who share the same race, culture, language, etc. to form an independent country Scottish nationalism"
Emphasis on the "share the same race, culture, language, etc".
That's very different from the simple notion that nations should exist.
At the root of this are feelings of superiority to those that don't share those aspects -- the out-group -- as illustrated again and again and again by the oppression of the out-group by the in-group.
"Obviously anyone would denounce xenophobia, racism, bigotry, and fascism and all the other vile actions you mention."
Obviously not anyone, or they would not be so popular.