I assume that you are asking this with regard to punishment for crime or other wrongdoing. The idea here is that humiliating people for what they have done wrong would act to deter them from doing it again. This is the idea behind such policies as printing the names of men who are arrested patronizing prostitutes. They are supposed to be deterred from doing wrong because they do not want to be humiliated in that way again. This idea is also meant to apply to people other than the offender. Those who see the names of the "johns" being published are supposed to refrain from patronizing prostitutes themselves so as to avoid humiliation.