I don't want to sideline this discussion, but this was not discussed before:
The fact is that there are support groups in every single community for such (sick) people. Similar to gamblers anonymous. So, there are some programs and help, people who have unhealthy habits can do if they want to get helped. So in theory there are helpful things they can do to get out of it. This is in no way a sign-off that they are safe. But besides the prison, or lets say in the above case where he had a 5 year plea bargain. He could've gone to such a program (I assume the court would require him to go)
1. Prison sentences are justice, they give closure to victims. AYLOR if that’s a justification, I’m not clear myself what to the Torah’s view is on this (in general, for any crime) as the Torah doesn’t really use prison, it would typically be malkos or misas BD.
2. They take someone dangerous off the streets. Whether that’s necessary is debatable.
3. They create a significant deterrent.
While such programs do exist, and the people working at those programs deserve commendation, someone with such proclivities can’t necessarily be healed.