…in righteousness you shall judge your nation. (Leviticus 19:15)
Aside from the negative mitzvah prohibiting them from perverting justice, the judges have a positive mitzvah requiring them to judge righteously. What, exactly, does that mean?
For one thing, it means treating both parties in a case equitably. For example, the judge may not permit one party to speak for as long as he likes and shut the other party up after three minutes.
This is also a general command for all people who are qualified to judge to do so. If one turns his back on the responsibility, he would be in violation of this obligation. (The obligation to judge righteously is actually the source of being dan l’kaf z’chus – giving others benefit of the doubt and judging them favorably in our day-to-day lives. This is similar to the secular concept of a “presumption of innocence.”)
The reason for this mitzvah is that equitable treatment helps the world stand up straight, metaphorically speaking. To treat different parties unequally skews things and makes the world lopsided, as it were. Imagine if you built a house using two different rulers, one a foot long and the other ten inches. The house would come out a crooked, ungodly mess. Well, if we apply different standards in judgment, our society will likewise come out a twisted wreck.
This mitzvah applies in all times and places. It is discussed in the Talmud in tractate Shevuos on page 30a-b and is codified in the Shulchan Aruch in Choshen Mishpat 17. This mitzvah is #177 of the 248 positive mitzvos in the Rambam’s Sefer HaMitzvos; it is not counted separately among the mitzvos that can be fulfilled today in the Sefer HaMitzvos HaKatzar of the Chofetz Chaim.