Nationalism is a weird ideology. It would be easy to imagine that it was cooked up by rulers looking for a means of keeping their victims submissive and cooperative.
A nationalist gives moral priority to others within the boundaries of his nation-state, or at least to his fellow citizens there, and he acts accordingly in political affairs. Yet even in a small nation-state, practically all these people are complete strangers. One has never met them, never will meet them, has only the foggiest idea of the sort of people they are. Maybe they speak his language, but many do not. Maybe they are of the same race, but many are not; and even if they are, so what? Maybe they share his cultural affinities, but maybe they don’t. Maybe they are not even decent people; in fact, many are complete creeps or criminals. Why should anyone give any kind of priority to them merely because they happen to be located within the boundaries of the same tax farm?
Nationalism is, among other things, a gigantic aggregation error. It takes a huge, enormously diverse collection of people and imagines that each and every individual in the collection is somehow better than each and every individual in other nation-states. The more you think about it, the more idiotic it becomes.