The value of shame lies in its power as a deterrent, not as a form of punishment. People behave in socially acceptable ways so that society will accept them; the threat or fear of losing that acceptance is what keeps (kept?) people on the straight and narrow.
By the time you sentence someone to the pillory, literally or metaphysically, it's too late to change his behavior and the pillory's purpose becomes a method pour encourager les autres. Being pilloried sucks, of course, but its purpose was never rehabilitative. That's not to say it can't be.
Shame or the threat of public humiliation didn't always work, either. If it had, our ancestors would have had no need for prisons and Nathaniel Hawthorne would never have written The Scarlet Letter. Which brings me to another limitation to shame: Can we restigmatize unmarriage without punishing the children of those unions?
In The Scarlet Letter, Hester Prynne was forced to wear the letter, go to prison and bring up her daughter alone while her lover just went about his business. True, Hester refused to name her lover and Dimmesdale "suffered" psychologically, but he basically suffered no material harm. Too often, the mothers and the children bore the brunt of the shame of illegitimacy by being ostracized and unable to find work to feed their children. That that is no longer the case is, I believe, a good thing.