The particularly violent ones have to be separated from general pop for everyone's safety. I'm not sure what they do to ensure they get enough socialization.
Solitary should only ever be used when you are a threat to the general prison population, or they are a threat to you, and in no other case. It should never be used as punishment, because it's horrific what it can do.