Maybe it'd be useful to make a distinction between being proud for something and proud of it.
When your team wins you feel proud for the way they played; but only the players really have the right to feel proud of the way they played.
And the same would go for being ashamed - of your team, things done by your country, whatever.
If I was a Muslim now I'd be feeling that the terrorist had brought shame on my religion, but I wouldn't agree with anyone who suggested that I had should be feeling ashamed of being a Muslim. The same if I'd been an American at the time of My Lai, or the carpet bombing campaign of carnage.