Public punishment and humiliation has been around since man has been in social groups.
The Bible references that Paul and Silas were put into stocks. Military deserters were put in stocks. So was the Puritan 'sinner' in colonial New England. Disobedient slaves were publicly whipped. For centuries persons have been hanged in public or nailed/tied to a pole/cross to die.
Today persons who break laws or social custom can receive public punishment. In the US a person can be given 'public service' hours or be assigned to a 'chain gang' with brightly colored clothes (or "I'm a drunk driver" shirt in some States). In Africa people are still publicly whipped, dismembered or stoned. In Southeast Asia, a lawbreaker can be publicly caned.
As a form of punishment with children, instead of receiving a spanking they are put in 'time out' or 'grounded' - banished from involvement in normal activities.
The same customs are practiced in religion.
ginger