This is probably something that a lot of people have said already in this thread, but here's why I experience shame (from an Enneagram 1 perspective). It's a pretty linear process:
1) I know what's correct. I've been taught what's correct and incorrect from a young age, and what hasn't been explained to me, I've judged for myself, in terms of correctness or incorrectness. Either way, everything has its category (note: these categories are subject to change at any moment; they are not concrete).
2) I know how and when I fail to be correct, right, or admirable.
3) I care enough about being correct, that I feel like I've failed, when I am incorrect. I beat myself up about it, because someone needs to discipline me for being bad.
Other people have mentioned the parent's role in shame -- and in my case (as well as other Enneagram 1s), my parents disciplined me very unevenly. They'd discipline me once or twice, and then be chill the rest of the time, trusting me to do the right thing because they recognized that I was a "good kid" and could be trusted to do the right thing. But the thing is, the uneven and unpredictable discipline meant that I never knew when to expect it -- and because it was infrequent, I never got used to it, so I remained very sensitive to criticism, both from myself and from other people.
Man, the Enneagram is great for telling you exactly how and why you're f*cked up
Oh, and p.s.: This thread is making me wonder how a person could be raised without shame. What parenting techniques would lead to that -- and what would the consequences be?
Edit:
Mixed messages. Your parents/family/close friends treat you like shit but the outside world pumps you up or vice versa, and you become confused. You feel like a fraud of some sort because you can't be worthless and the center of the universe all at the same time, right? But you'll never know which one is right because no one is truly qualified to give you the "right" answer other than yourself, and yet you've been trained from day one to never trust your own judgement, it always has to be backed up by an outside source. Or anyhow, that's the observation I've made.
Ooh, yeah, totally. This too. It was "vice versa" for me -- in late elementary/middle school, I could never figure out whether I was as awesome as my parents, teachers, and family friends told me I was, or as horrible and disgusting as i must have been to justify having so few friends.