I don't mind when parents are shaming their children as a form of punishment, although they should be careful not to make sure the punishment fits the crime. For example, if the kid is being a bully at school, then by shaming their child, hopefully the kid will realize how hurtful it is to pick on someone. However if the kid forgot their homework, then I don't think that shaming the kid will teach him anything.
However I don't think that it's right to shame another adult, at least not by the general public. If the person committed a crime, then have them arrested and punished through the legal system. Otherwise, live and let live. If the person is known by you and your friends, then you may talk / gossip about that person in your inner circle so that you don't fall victim to this person, but otherwise publicly shaming this person just becomes exploitative.
That being said, I don't think that shaming by the government would be that terrible as a form of punishment. If it was done by the government, then at least the person had a trial to try to defend themselves. It would also (hopefully) be handled equally among the population for similar crimes. Although stockades or wearing "scarlet letters" may be viewed as a cruel / unusual punishment, there are other more modern forms of shaming that a government may try to use. In fact, some states already do have a form of shaming as a form of punishment. For example, Cincinnati is thinking of publishing convicted prostitution clients (johns) in the newspaper as a way to help curb prostitution and sex trafficking (
http://www.cincinnati.com/story/news/politics/2014/04/30/city-publicize-johns-names/8530827/). Other cities have already instituted this as a form of punishment, and some are adding mug-shots to the names of the johns in their publications.