Isolation and penitence --- the original historical roots of the word "penitentiary."
When the danger of moral contagion is high, the perpetrator should be stoned to death. A more liberal application of the death penalty would have a salubrious effect on society.