Having spent more days in the court system as an observer than I care to recount, I hate, hate, hate mandatory minimum sentences. Some/most of those sentences were passed by legislators to express displeasure with the class most likely to commit the crimes associated with them, while others were the result of a local need to keep prisons full
Of course, there are ways around such things. One local judge will give a 20-year sentence and suspend all but one day of it upon the payment of a nominal fine. It still goes on the book as a 20-year sentence, but for many offenders credit for time served bounces them free that day. (Most crack offenders can't afford the bond and sit in jail for months awaiting trial or an opportunity to plead out.) The judge usually does this for lesser drug offenses.
If we're talking about jail/prison conditions themselves, of the three prisons/county lockups I've been in (again, as an observer), two were on exhibit especially because the people who run them think they border on the side of endangerment.