Check out this excellent article by Stephanie Mencimer in Mother Jones, which refers to a new report by the Treatment Advocacy Center, a group that works to remove barriers to effective treatment of mental illness throughout the United States.
Our nation has long since made the switch from treating the mentally ill in mental hospitals....to treating them (poorly, according to the TAC report) in jails and prisons. Sadly, as Mencimer points out, this vulnerable group is also more likely to be overrepresented in solitary confinement, which has be shown to have incredibly detrimental effects on even otherwise mentally healthy people. They are also much more likely to commit suicide while in custody.
The ACLU of Utah is currently working with state and county partners to help connect criminal-justice-involved people with the treatment they need - most often for mental illness and also substance use disorders - and save them from damaging time spent behind bars.