This week's Parsha, משפטים, begins with the subject of עבד עברי, the Hebrew slave. One of the ways that a Jew becomes a Hebrew slave, is that he is a thief who is unable to pay back what he stole.
The Torah does not believe that jail is a good form of rehabilitation, and only is used on rare occasions and only for brief periods. The way to rehabilitate a thief is to build up his self esteem by having him live with a good Jewish family for six years, and working for them.
Years ago I read a report from criminologists that wrote that they came to the realization that jail is not a good system. They also found that the thief needs to gain self respect and dignity and see himself as part of society. This is best achieved by living with a family that will accept him and help build him up.
Once again we see the wisdom of the Torah that always shows itself as the ultimate in wisdom and understanding.