Yes indeed. It forms bonds of association. If I'm in some god-forsaken country in this world, my face always brightens when I hear an American/Canadian accent. If an earthquake strikes California, I feel a lot more pain than a simliar earthquake hitting people I don't know.
The more I associate with someone, the more inclined I am to feel his or her pain, joy, and other emotions. And I do think that pledging allegiance and singing the national anthem as a nation does a lot for the soul.