A good portion of the inmate population aren't normal stable personalities. They are mentally ill and without access to mental health support run afoul of the law. When placed in a prison with still no mental health supports they act out and end up in segregation which just further aids in the deterioration of their mental health.