In Britain, public executions of criminals were required by law until 1865.There used to be public executions, FYI.
The idea that they reduce crime is a myth. In the early 18th Century, lawlessness was at a peak and in desperation the government made 160 crimes punishable by death i.e. public hanging. The hangings became a great spectacle, but they did no good in the sense of deterring crime. One such crime was pickpocketing. It is reported that pickpockets were operating in the very crowds that were watching a man being hanged for pickpocketing.
What reduced crime was the "Great Awakening" - the revival that began around 1735 and is associated with George Whitefield and John and Charles Wesley.