I am not sure how addicts were treated by law enforcement historically but would be curious to hear about that. Just my own intuition says they probably were treated under existing vagrancy laws "Vagrancy laws took myriad forms, generally making it a crime to be poor, idle, dissolute, immoral, drunk, lewd, or suspicious."
The prison guard union is one of the most powerful lobbyist groups in California (and significant in the US as a whole) and has all the same perverse incentives as private prisons.
If you want to really address the problems, the prison guard union and police unions are literally 100x more powerful and impactful to laws and policies, and their PR teams love it that the internet stays distracted by the 8.2% of prisoners who are housed in privately-run prisons.