Philippa Foot is most known for her invention of the Trolley Problem thought experiment in the 1960s. A lesser known variation of hers is as follows:
Suppose that a judge is faced with rioters demanding that a culprit be found for a certain crime. The rioters are threatening to take bloody revenge on a particular section of the community. The real culprit being unknown, the judge sees himself as able to prevent the bloodshed from the riots only by framing some innocent person and having them executed.
These are the only two options: execute an innocent person for a crime they did not commit, or let people riot in the streets knowing that people will die. If you were the judge, what would you do?
Executing an innocent person is never just. A judge of the justice system must be just above anything else like politics or outside consequences.
The judge does not “let the people riot”. Saying it like that misleads into thinking so. The judge is not the active part in that. The rioters are the actors and can and must be brought to justice when they can/later.
It’s not on the judge to weigh on outsiders and outside consequences. They must gather and assess the concern at hand concerning a person at hand. Outside factors are irrelevant. Influences onto the case may be relevant, but not the other way around.
If a judge and by consequence the justice system loses it’s justice and fairness it loses all of its most important, primary, and possibly single responsibility and trust. Without a just justice system, it is bound to end up will all manner of corruption, arbitrariness, and secondary factors of no societal trust in a justice system (leading people to execute self-justice; what the example tried to evade in the first place).