A true victorian, Charles Darwin thought that shame, and the characteristic blushing stigma that goes with it, were uniquely human moral adaptations (see The Expression of Emotions in Man and Animals, chap.3). Moral philosophers in the naturalist trend, such as Allan Gibbard, extended this view by adding guilt as the second building block of our moral-emotional repertoire. Why did Evolution took care to provide us with such dismal feelings, the rest of the animal kingdom seemingly spared?

Humans are extraordinarily cooperative animals (compared to other species) and at least some of this cooperation seems to be promoted and fostered by moral feelings; so it makes evolutionary sense to assume that moral feelings such as guilt and shame are somewhat adapted to sustain cooperation. But we also learn from evolutionary modeling that cooperation can fail, particularly when would-be cooperators cannot trust one another, or when unskilled or weak cooperators are chosen. Good cooperators tend to work with other good cooperators: in this way their investment can pay back. The overall result is that sustainable cooperation cries for honest and reliable ways for individuals to signal that they are willing to cooperate honestly with others, and that they're good at it. Costly, publicly-displayed and involuntary emotions can be such signals.

In this view, guilt's function is to make you feel (in a costly and mandatory manner, that makes this emotion an honest signal of your natural propension to cooperate) that you acted like a poor cooperator. Shame, on the other hand, serves to remind you that you did something that, while unharmful to others, makes you look like a very poor cooperator (because you're an unhealthy, resourceless, low-ranking individual, whatever). Actions that induce guilt may also provoke shame, but not necessarily so (and the reverse is also true). Guilt promotes cooperation regardless of cooperation being noticed or not, while shame discourages displaying your flaws and weaknesses in front of potential associates.

Back to the fMRI data: you would expect from this sketchy theory of guilt and shame that shame- and guilt- activated brain areas overlap to a certain extent, since most guilty acts provoke shame, and shameful actions can also be guilty. But guilt-activated brain areas, contrary to shame-activated ones, should not react to the social perception of the action (whether it is seen or not, how it is judged). Socially inappropriate behavior should induce shame only when it is witnessed. Shame should not be provoked by a socially inappropriate action without witnesses.

Summing up: if your fly is opened and your underwear is showing in front of a whole assembly, you're ashamed , but you feel no guilt (inappropriate behavior+audience=shame). If you're home alone when you remark that your underwear is showing, you do not blush unless you are an Anglican spinster (inappropriate behavior w/o audience=nothing). If you just killed the one you love, you feel guilt even if no one saw you do so and you do not expect anyone to suspect you (unacceptable behavior with or without witness=guilt). No I'd better let you deal with the murder before you find that while killing your s.o., you inadvertently let your fly opened.

The team of neuroscientists led by Elizabeth Finger and James Blair found activations coherent with these remarkably specific predictions. Second-person narratives of neutral, morally unacceptable and socially inappropriate behaviors were presented to the subjects; for each condition, the behavior could be witnessed or not. While the dorsomedial prefrontal cortex was involved in the perception of morally unacceptable behavior regardless of the presence or absence of audience, it was activated by inappropriate behavior if and only if it had witnesses.

Other areas are activated by moral and, to a lesser extent, social transgressions vs. neutral behaviors, and some of these are known to be involved in Theory of Mind tasks. What is puzzling is that many of these ToM areas do not react to the presence or absence of an audience, which is puzzling since processing others' mental states are supposedly what ToM is about. ToM-associated activations do not overlap at all with audience-related activations. I don't know enough about the neuroscience of ToM to solve this riddle. A guess, anyone?