I think it's about a need to be part of a pack or larger group.
And nationality is something we can largely identify with.
It becomes more engrained, when you feel threatened by or a grievance towards a neighbor, for example if your nation was at war with a neighbouring country.

I think it is becoming less prevalent with the younger generation because the troubles in Ireland at least were not part of growing up for people in their teens today.

Witness how many young Irish boys were foreign football teams jerseys, and I'm talking international teams, not just clubs.

I do think there is a lot of bullshit around patriotism. For example, I find the practice of singing national anthems almost as bizarre as mass!

But as a man in his 40's, buy me a couple of drinks and ask me what I think of the Brits involvement in northern Ireland ...