Do not make a perversion of justice… (Leviticus 19:15)
This mitzvah specifically applies to judges in civil suits, who are supposed to decide cases on the basis of facts and that’s all.
One of the most widely-studied texts in all of Judaism is Pirkei Avos, commonly (though not particularly accurately) translated as “Ethics of the Fathers.” Among this tractate are many rules for living, many of which speak directly to the judges of the nation. “Be deliberate in judgment” is the very first teaching in the tractate (Avos 1:1). Another teaching is that a judge should consider the possibility that either party in a civil suit may be wrong but after judgment is rendered, he must assume that all parties will live up to their obligations (1:8). Elsewhere, judges are told to treat a case involving a single dollar as seriously as a case involving $1,000,000 (Talmud Sanhedrin 8a; prices adjusted for inflation). There are many such directives given to help the judges do their jobs as uprightly as humanly possible.
The reason for this mitzvah is clear: honest courts are necessary for a smooth-running society. Corrupt courts are a huge factor in perpetuating a corrupt society.
This mitzvah applies in all times and places. It is discussed in the Talmud in the first chapter of tractate Sanhedrin and elsewhere. It is codified in the Shulchan Aruch in Choshen Mishpat 17. This prohibition is #273 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos and #69 of the 194 negative mitzvos that can be fulfilled today as listed in the Sefer HaMitzvos HaKatzar of the Chofetz Chaim.