Nationalism, the feeling of belonging to a nation, tribe, call it whatever you want to, is innate. You can say its imperfection, but then again the human race isn't perfect to begin with. It is our imperfections that define us, and make us more human.
Even Dogs are loyal and territorial. And that, imo is just an instinct by another name..
It's one of our more admirable characteristics, but it is far from exclusively human.