https://en.wikipedia.org/wiki/Prison%E2%80%93industrial_comp...
I agree with your sentiment but I find it odd that you think judges are the worst. Of all the people in the system judges are probably the least worst because they don't have as many incentives to do things that are bad for society but good for them personally the way all the other actors do (i.e. they do not directly benefit from the war on drugs).
The bad incentive for judges seems to be that most of them have a desire to not rock the boat too much which is pretty benign compared to all the other actors who go out of their way to perpetuate and further the status quo because they materially benefit from it.
I find it hard to fault the judges for apathetically presiding over a flawed system when every other group you mentioned is doubling down to further that system.
Imagine a world where criminal gangs don't have access to the money they make through drugs and a government that doesn't have to spend huge amount of money on drug laws enforcement because drug trafficking would be much less lucrative in the existence of legal access and you get fewer and very cash-strapped drug gangs, and government making money from taxing drugs.
Surely such massive savings and earnings can be spent to help problem users and reduce violence, no?