As far as I can tell, it's a behavior that comes from the same source as almost every behavior related to people encountering each other; people seem to have an almost desperate need to put themselves on a pedestal as superior to those around them, and will use any means necessary to do so. My country is better than yours, my political affiliation is better than yours, my religion is better than yours, my lifestyle, my race, my language, my culture, my things I own, my fashion, so on and so on. Even down to the tiniest scale, you can see the same thing around here in those Morrowind vs Oblivion arguments and similar, people treat them like sports teams. They get so defensive that soon it has nothing to do with any actual pros/cons to the game, so much as "this game is better because it's the one *I* like best".
The same gets applied to countries, as that quote a while back noted. People are proud of their country primarily because it's
their country. If they grew up somewhere else, they would love
that country. The focus is not the place, but them, in odd sort of subconscious selfishness. The same idea happens even with those who have low self-esteem, who tend to reject the outside with less a sense of self-aggrandizement as a contempt for outside opinions as inherently faulty and inferior. It's not always (maybe even not often) a matter of pompousness and "I'm better than everyone" feelings, but a subconscious part of human behavior.
Edit: Chavs is censored? Huh. (talking about http://tinyurl.com/3j9gags since you can't see the censored word.)
You mean teenagers? Yeah that culture tends to be pretty awful.
Wait, what? I'm proud to be an American. Why? Because no matter how much [censored] we produce, I'm free, free, free to worship my God, free to vote, free to own a gun in my house etc. I love America. Nationalism is not non-sensical at all.
The idea is that love, respect, enjoyment, or other feelings are not the same as "pride". I might buy and eat an especially delicious sandwich for lunch, and be glad that I have the opportunity for that sandwich, but it doesn't really make sense to be
proud of the sandwich.