We also decided it was cheaper. It was expensive to keep whole institutional systems, and it was expensive to keep them in jail.
A lot of recent sentencing reform was motivated by the desire to lower the cost of running prisons, and started off Republican-led. Whenever people talk about solving mental health crises with jail time, no one is willing to put up the money.