No becasue the idea itself is uncessarily cruel, but becasue of the way a jail is run. People are given very little and treated very horribly. This does not have the intented effect, and often causese them to bond with fellow inmates, but this is bad because they commit crimes together.
This question has no easy answer. For starters, sentences for drug-related felonies (not dealing, mind you, just consumption) are too long. These sentences should be shorter, especially for first time offenders. There should also be an assessment as to whether rehab would be a better solution. This should be done on a case-by-case basis. However, there is the other perspective that some jail sentences are too short. This is particularly true for violent crimes where the sentence is negotiated down to a much lower number than the crime requires. Other crimes where this is frequently true is any case where there are multiple criminals (i.e. they flip on each other for lighter sentencing) and espionage/treason.
Jail sentences are needlessly cruel and inhumane. People are imprisoned for far too long for nonviolent crimes. Additionally, jail sentences for minor issues such as traffic violations, are not uncommon for individuals who cannot afford to pay fines. These types of sentences should not exist. Jails also lack the resources for rehabilitation, which is unfair for the individuals living there.
It is frustrating for the law-abiding public to watch a person be sentenced for their fifth or sixth drunk driving offense with only a short term in prison. It is frustrating to watch someone sell drugs again and again and again only to be released and do it again. Sentences should be longer and should include more rehabilitative programs.