Anyhow, this an aspect of the separation of powers between the legislative and judicial branches of government[2]. The general principle is that the people who decide what the laws will be are not allowed to directly apply those laws to individual citizenry, lest they do unfairly. The courts are allowed to examine the particulars of any given case to determine how the law applies and are allowed some leeway to decide what and how penalties are to be individually imposed.

What you are asking for is a mandatory sentencing system[3] where the individual facts of the case can't be considered in determining the punishment for a particular case. This one-size-fits-all approach to punishment is unfair because it presupposes that all crimes that fall afoul of a given law fit within the narrow envelope that congress envisaged. In fact laws often apply to people and cases that are not so black and white and giving judges who are privy to the actual facts of a given case some leeway at least in theory improves fairness when compared to the black box approach. Let the punishment fit the crime of the individual, not the crime imagined by congress when they wrote the relevant law.