There may be times when a prisoner is acting out in a potentially violent way that solitary confinement is necessary. However, in most cases it just makes prisoners angry and takes away their humanity and ability to socialize. If they get out of prison, they will be more violent, so solitary needs to be a very limited option for brief periods of time.
Solitary confinement is an effective way to demoralize dangerous inmates. If anything, every prisoner should probably experience solitary for at least 24 hours to see what it feels like so as to act as a deterrent. Not everyone responds well to solitary, but it works in a pinch to keep unruly prisoners from hurting others.