Legislators don't have, and cannot have, prior knowledge of all the mitigating factors in a particular breach of the law. To allow them to dictate minimum sentences without access to the full details of each case is dangerous and stupid, and is an abuse of the separation of powers.
Yes, but we have this huge problem, they tell us, with bleeding heart liberal judges who keep letting these despicable people off with warnings or wrist slaps or non-meaningful punishments.
Or the District Attorney declines to prosecute because he's a namby pamby bleeding heart or something.
So the legislature was forced, simply forced, to make sure that the prosecutor has to prosecute and the judge has to jail the miscreant.
THen we get these ridiculous press meetings where the same legislators implore the prosecutor NOT to prosecute the mislead youth or the unfairly charged girl or the college bound kid who had had such a bright future before he was caught selling drugs within ten feet of a school. The Law-And-Order candidate begging the Law to break the law...