"You shall not pervert the judgment of your needy one" (Exodus 23:6). Why do I need this? Has it not already been said, "You shall not pervert judgment" (Deuteronomy 16:19), whether of poor or rich? What then does "You shall not pervert the judgment of your needy one" teach? This is one who is needy in commandments [poor in good deeds]. You should not say: he is wicked, his presumption is that he lies, and this other man's presumption is that he does not lie; let me pervert the judgment against him. Therefore Scripture teaches, "You shall not pervert the judgment of your needy one." Another interpretation: "the judgment of your needy one" you may not pervert, but you may incline the judgment of another. From here they said: an Israelite and a gentile who came to judgment — if Israel has the right under our law, we judge for him by our law and tell him, "This is our law"; and if Israel has the right under the laws of the nations, we judge for him by their laws and tell them, "This is your law."
Do Not Pervert the Justice of the Needy
Mekhilta DeRabbi Shimon Ben Yochai 23:6
לא תטה משפט אביונך מה אני צריך והלא כבר נאמר (דברים ט״ז י"ט) לא תטה משפט אחד עני ואחד עשיר מה ת"ל לא תטה משפט אביונך זה אביון במצוות שלא תאמר רשע הוא חזקתו שהוא משקר וחזקת זה שאינו משקר אעבר עליו את הדין ת"ל לא תטה משפט אביונך: ד"א משפט אביונך אי אתה מטה מטה אתה דינו של אחר מכאן אמרו ישראל וגוי שבאו לדין אם יש זכות לישראל בדינינו דנין לו בדינינו ואומר לו כך דינינו ואם יש זכות לישראל בדיני גוים דנין לו בדיניהם ואומרין כך דינכם: