There are a number of possible arguments for why mandatory minimum sentences are just. Let us look at a few of them.
They ensure that people do not get off too lightly. Without mandatory minimum sentences, it is too likely that some criminals will get off with very light sentences. Judges will get taken in by the convicts’ stories about why they should be treated leniently. Judges will give short sentences so as not to strain prisons. People who commit crimes will get off with much lighter punishments than they deserve. This is not just.
They ensure that criminals are treated equally. If there are no mandatory minimums, convicts get treated differently. White convicts might, for example, get much lighter sentences than blacks do. Mandatory minimum sentences reduce the level of inequality in sentences and are, therefore, more just.
They allow us to protect our society. One aspect of justice is providing protection for society as a whole. We cannot have a just society if offenders are getting off lightly. This does not provide us with any sort of certainty that our rights as citizens are being protected through tough punishments of those who would violate them.
If we accept these arguments, mandatory minimums are necessary to ensure justice.