If being in prison was sufficiently bad enough, it might be a deterrent. But alas, judges have taken control of this among many issues, and made prisons just too comfy.
No hard labor, nutritious food, medical care, heated and air conditioned, etc.
For most inmates, a prison sentence is a comfortable vacation from criminal lives on the street.