Judges, Ants, and Justice
זֶה שֶׁאָמַר הַכָּתוּב (משלי ו, ו ח): לֵךְ אֶל נְמָלָה עָצֵל רְאֵה דְרָכֶיהָ וַחֲכָם אֲשֶׁר אֵין לָהּ קָצִין שֹׁטֵר וּמשֵׁל תָּכִין בַּקַּיִץ לַחְמָהּ אָגְרָה בַקָּצִיר מַאֲכָלָהּ, מָה רָאָה שְׁלֹמֹה לְלַמֵּד לְעָצֵל מִן הַנְּמָלָה, רַבָּנָן אָמְרֵי הַנְּמָלָה הַזּוֹ שְׁלשָׁה בָּתִּים יֵשׁ לָהּ, וְאֵינָהּ כּוֹנֶסֶת בָּעֶלְיוֹן מִפְּנֵי הַדֶּלֶף, וְלֹא בַּתַּחְתּוֹן מִפְּנֵי הַטִּינָה, אֶלָּא בָּאֶמְצָעִי, וְאֵינָהּ חַיָּה אֶלָּא שִׁשָּׁה חֳדָשִׁים, לָמָּה, שֶׁמִּי שֶׁאֵין לוֹ גִּידִים וַעֲצָמוֹת אֵינָהּ חַיָּה אֶלָּא שִׁשָּׁה חֳדָשִׁים, וְכָל מַאֲכָלָהּ אֵינָהּ אֶלָּא חִטָּה וּמֶחֱצָה, וְהִיא הוֹלֶכֶת וּמְכַנֶּסֶת בַּקַּיִץ כָּל מַה שֶּׁמּוֹצְאָה, חִטִּין וּשְׂעוֹרִין וַעֲדָשִׁים. אָמַר רַבִּי תַּנְחוּמָא וְכָל חַיֶּיהָ אֵינָהּ אֶלָּא חִטָּה וּמֶחֱצָה, וְהִיא כּוֹנֶסֶת אֶת אֵלּוּ, וְלָמָּה הִיא עוֹשָׂה כֵן, שֶׁאָמְרָה שֶׁמָּא יִגְזֹר עָלַי הַקָּדוֹשׁ בָּרוּךְ הוּא חַיִּים וְיִהְיֶה לִי מוּכָן לֶאֱכֹל. אָמַר רַבִּי שִׁמְעוֹן בֶּן יוֹחַאי מַעֲשֶׂה הָיָה וּמָצְאוּ בַּבּוֹר שֶׁלָּהּ שְׁלשׁ מֵאוֹת כּוֹר, מַה שֶּׁמְּכַנֶּסֶת מִן הַקַּיִץ לַחֹרֶף, לְפִיכָךְ אָמַר שְׁלֹמֹה לֵךְ אֶל נְמָלָה עָצֵל רְאֵה דְּרָכֶיהָ וַחֲכָם, אַף אַתֶּם הַתְקִינוּ לָכֶם מִצְווֹת מִן הָעוֹלָם הַזֶּה לָעוֹלָם הַבָּא. וּמַהוּ רְאֵה דְּרָכֶיהָ וַחֲכָם, רַבָּנָן אָמְרֵי רְאֵה דֶּרֶךְ אֶרֶץ שֶׁיֵּשׁ בָּהּ שֶׁבּוֹרַחַת מִן הַגָּזֵל. אָמַר רַבִּי שִׁמְעוֹן בֶּן חֲלַפְתָּא מַעֲשֶׂה בִּנְמָלָה אַחַת שֶׁהִפִּילָה חִטָּה אַחַת, וְהָיוּ כֻּלָּן בָּאוֹת וּמְרִיחוֹת בָּהּ, וְלֹא הָיְתָה אַחַת מֵהֶן נוֹטֶלֶת אוֹתָהּ, בָּאָה אוֹתָהּ שֶׁהָיְתָה שֶׁלָּהּ וְנָטְלָה אוֹתָהּ, רְאֵה חָכְמָה שֶׁיֵּשׁ בָּהּ. וְכָל הַשֶּׁבַח הַזֶּה שֶׁיֵּשׁ בָּהּ שֶׁלֹא לָמְדָה מִבִּרְיָה, וְלֹא שׁוֹפֵט וְלֹא שׁוֹטֵר יֵשׁ לָהּ, שֶׁנֶּאֱמַר: אֲשֶׁר אֵין לָהּ קָצִין שֹׁטֵר וּמשֵׁל, אַתֶּם שֶׁמִּנִּיתִי לָכֶם שׁוֹפְטִים וְשׁוֹטְרִים עַל אַחַת כַּמָּה וְכַמָּה שֶׁתִּשְׁמְעוּ לָהֶן, הֱוֵי שֹׁפְטִים וְשֹׁטְרִים תִּתֶּן לְךָ בְּכָל שְׁעָרֶיךָ.

This is what Scripture says, "Lazybones, go to the ant; study its ways and learn. Without leaders, officers, or rulers, it lays up its stores during the summer, gathers in its food at the harvest."(Proverbs 6:6-6:8) What did Solomon see to learn from the ant regarding the lazy person? Our rabbis say that the ant has three houses (or floors), and it does not congregate in the top (floor) because of rain, nor does in the bottom because of mud, but rather in the middle. And it only lives for six months. Why? Because anything that does not have sinews or bones only lives six months. And all of its food is a grain and a half. And it goes and gathers in the summer all that it finds, grain and barley and lentils. Rabbi Tanchuma said: All of its life is a grain and a half and (yet) it gathers these? And why does it do this? Because it says: Perhaps the Holy One Blessed Be God will decree life and it will be prepared for me to eat. Rabbi Shimon ben Yochai said: It once happened that they found a pit of it (an ant) that had three hundred kor (of food grains). What they gather from the summer is for the winter, therefore Solomon said: "Lazybones, go to the ant; study its ways and learn." So to you shall fix for yourselves mitzvot from this world for the world to come. And what is "study its ways and learn"? Our rabbis say study its manners, because it flees from theft. Rabbi Shimon ben Halafta said: It once happened that a single ant dropped a grain. And all of them (the ants) were coming by and smelling it, and yet not one of them took it. The one who it belonged to came and took it. See the wisdom that there is in it (the ant). And all of this praise that it has it did not learn from a creation, and it does not have a judge or an officer. As it is stated, "Without leaders, officers, or rulers." You for whom I have designated judges and officers, all the more-so that you shall listen to them, and there will be judges and officers set for you in all of your gates.

(יח) שֹׁפְטִ֣ים וְשֹֽׁטְרִ֗ים תִּֽתֶּן־לְךָ֙ בְּכָל־שְׁעָרֶ֔יךָ אֲשֶׁ֨ר יְהוָ֧ה אֱלֹהֶ֛יךָ נֹתֵ֥ן לְךָ֖ לִשְׁבָטֶ֑יךָ וְשָׁפְט֥וּ אֶת־הָעָ֖ם מִשְׁפַּט־צֶֽדֶק׃ (יט) לֹא־תַטֶּ֣ה מִשְׁפָּ֔ט לֹ֥א תַכִּ֖יר פָּנִ֑ים וְלֹא־תִקַּ֣ח שֹׁ֔חַד כִּ֣י הַשֹּׁ֗חַד יְעַוֵּר֙ עֵינֵ֣י חֲכָמִ֔ים וִֽיסַלֵּ֖ף דִּבְרֵ֥י צַדִּיקִֽם׃ (כ) צֶ֥דֶק צֶ֖דֶק תִּרְדֹּ֑ף לְמַ֤עַן תִּֽחְיֶה֙ וְיָרַשְׁתָּ֣ אֶת־הָאָ֔רֶץ אֲשֶׁר־יְהוָ֥ה אֱלֹהֶ֖יךָ נֹתֵ֥ן לָֽךְ׃ (ס)

(18) You shall appoint magistrates and officials for your tribes, in all the settlements that the LORD your God is giving you, and they shall govern the people with due justice. (19) You shall not judge unfairly: you shall show no partiality; you shall not take bribes, for bribes blind the eyes of the discerning and upset the plea of the just. (20) Justice, justice shall you pursue, that you may thrive and occupy the land that the LORD your God is giving you.

משפט צדק תהי קבלת הטענות באופן שיפסקו הדין בצדק שלא יהא רך לזה וקשה לזה:

משפט צדק, the manner in which the complaints of the litigants were heard should be such that the resulting decisions could be expected to be fair, צדק, righteous. The judges were not to discriminate in their treatment of either of the opposing litigants.

(ט) וּֽבְקֻצְרְכֶם֙ אֶת־קְצִ֣יר אַרְצְכֶ֔ם לֹ֧א תְכַלֶּ֛ה פְּאַ֥ת שָׂדְךָ֖ לִקְצֹ֑ר וְלֶ֥קֶט קְצִֽירְךָ֖ לֹ֥א תְלַקֵּֽט׃ (י) וְכַרְמְךָ֙ לֹ֣א תְעוֹלֵ֔ל וּפֶ֥רֶט כַּרְמְךָ֖ לֹ֣א תְלַקֵּ֑ט לֶֽעָנִ֤י וְלַגֵּר֙ תַּעֲזֹ֣ב אֹתָ֔ם אֲנִ֖י יְהוָ֥ה אֱלֹהֵיכֶֽם׃ (יא) לֹ֖א תִּגְנֹ֑בוּ וְלֹא־תְכַחֲשׁ֥וּ וְלֹֽא־תְשַׁקְּר֖וּ אִ֥ישׁ בַּעֲמִיתֽוֹ׃ (יב) וְלֹֽא־תִשָּׁבְע֥וּ בִשְׁמִ֖י לַשָּׁ֑קֶר וְחִלַּלְתָּ֛ אֶת־שֵׁ֥ם אֱלֹהֶ֖יךָ אֲנִ֥י יְהוָֽה׃ (יג) לֹֽא־תַעֲשֹׁ֥ק אֶת־רֵֽעֲךָ֖ וְלֹ֣א תִגְזֹ֑ל לֹֽא־תָלִ֞ין פְּעֻלַּ֥ת שָׂכִ֛יר אִתְּךָ֖ עַד־בֹּֽקֶר׃ (יד) לֹא־תְקַלֵּ֣ל חֵרֵ֔שׁ וְלִפְנֵ֣י עִוֵּ֔ר לֹ֥א תִתֵּ֖ן מִכְשֹׁ֑ל וְיָרֵ֥אתָ מֵּאֱלֹהֶ֖יךָ אֲנִ֥י יְהוָֽה׃ (טו) לֹא־תַעֲשׂ֥וּ עָ֙וֶל֙ בַּמִּשְׁפָּ֔ט לֹא־תִשָּׂ֣א פְנֵי־דָ֔ל וְלֹ֥א תֶהְדַּ֖ר פְּנֵ֣י גָד֑וֹל בְּצֶ֖דֶק תִּשְׁפֹּ֥ט עֲמִיתֶֽךָ׃ (טז) לֹא־תֵלֵ֤ךְ רָכִיל֙ בְּעַמֶּ֔יךָ לֹ֥א תַעֲמֹ֖ד עַל־דַּ֣ם רֵעֶ֑ךָ אֲנִ֖י יְהוָֽה׃ (יז) לֹֽא־תִשְׂנָ֥א אֶת־אָחִ֖יךָ בִּלְבָבֶ֑ךָ הוֹכֵ֤חַ תּוֹכִ֙יחַ֙ אֶת־עֲמִיתֶ֔ךָ וְלֹא־תִשָּׂ֥א עָלָ֖יו חֵֽטְא׃ (יח) לֹֽא־תִקֹּ֤ם וְלֹֽא־תִטֹּר֙ אֶת־בְּנֵ֣י עַמֶּ֔ךָ וְאָֽהַבְתָּ֥ לְרֵעֲךָ֖ כָּמ֑וֹךָ אֲנִ֖י יְהוָֽה׃ (יט) אֶֽת־חֻקֹּתַי֮ תִּשְׁמֹרוּ֒ בְּהֶמְתְּךָ֙ לֹא־תַרְבִּ֣יעַ כִּלְאַ֔יִם שָׂדְךָ֖ לֹא־תִזְרַ֣ע כִּלְאָ֑יִם וּבֶ֤גֶד כִּלְאַ֙יִם֙ שַֽׁעַטְנֵ֔ז לֹ֥א יַעֲלֶ֖ה עָלֶֽיךָ׃ (פ)

(9) When you reap the harvest of your land, you shall not reap all the way to the edges of your field, or gather the gleanings of your harvest. (10) You shall not pick your vineyard bare, or gather the fallen fruit of your vineyard; you shall leave them for the poor and the stranger: I the LORD am your God. (11) You shall not steal; you shall not deal deceitfully or falsely with one another. (12) You shall not swear falsely by My name, profaning the name of your God: I am the LORD. (13) You shall not defraud your fellow. You shall not commit robbery. The wages of a laborer shall not remain with you until morning. (14) You shall not insult the deaf, or place a stumbling block before the blind. You shall fear your God: I am the LORD. (15) You shall not render an unfair decision: do not favor the poor or show deference to the rich; judge your kinsman fairly. (16) Do not deal basely with your fellow citizen. Do not profit by the blood of your fellow: I am the LORD. (17) You shall not hate your kinsfolk in your heart. Reprove your kinsman but incur no guilt because of them. (18) You shall not take vengeance or bear a grudge against your fellow citizen. Love your fellow as yourself: I am the LORD. (19) You shall observe My laws. You shall not let your cattle mate with a different kind; you shall not sow your field with two kinds of seed; you shall not put on cloth from a mixture of two kinds of material.

משפט צדק. ולא אמר בצדק כאומרו (ויקרא י''ט ט''ו) בצדק תשפוט עמיתך, כאן העיר הערה גדולה לחפץ לשפוט בצדק, והוא כי כשירצה לעמוד הדיין על משפט האנשים אשר להם הריב יהיה בסדר זה שיעביר מבין עיניו ב' הנושאים ולא ילביש משא ומתן ההלכות שיעשה באנשים אשר להם הריב לומר כפי זה יתחייב פלוני וכפי זה יהיה להיפך אלא יעשה עיונו וצדדי ההלכה כאלו אין אדם שצריך להוראה זו עתה אלא לעמוד על הדין לדעת הלכות התורה, ואחר שיעמוד עליו בדרך זה מה שיעלה במצודתו ידין בו לבעלי דינים יזכה הזכאי ויתחייב החייב, והוא אומרו ושפטו את העם משפט פירוש כבר הוא משפט בפני עצמו זה יהיה צדק, אבל זולת זה כשיעריך בדעתו בעת שמזקק ומצרף הדין לבעלי דינים על כל פנים יהיה א' יותר מתקרבת דעתו אליו ולא יצא המשפט צדק, ובפרט במשפטים שתלוים בשיקול הדעת ובהטיה מועטת בנקל יטה דעתו:

משפט צדק. "righteous judgment." The Torah did not write בצדק as it did in Leviticus 19,15 where it legislated something similar. In our verse -which is addressed to the judges- the Torah teaches the judges something of great importance. If the judge is truly interested in handing down true judgment, they must dissociate themselves from the persons, i.e. the litigants before them and weigh only legal considerations. They must not say to themselves that according to the arguments of litigant A, B must be guilty, whereas according to the arguments of litigant B, A must be guilty. They must research only the halachah on the subject matter in dispute. If they were to approach the matter differently they could not help but develop some bias in favour of one of the litigants. As a result the judgment would not reflect true righteousness, צדק. When the judge follows the procedure the Torah suggests then they first forms judgment, משפט, which turns out to be צדק, righteousness. [You will observe that in the quotation from Leviticus 19,15 the Torah describes the reverse sequence, i.e. your interest in righteousness obliges you to pronounce judgment. In that instance a variety of considerations ultimately demanded that you resort to law rather than mediation, etc. Ed.]

ובדרך רמז ירמוז על דרך אומרו (תהלים צ''ו) ישפוט תבל בצדק, ואמרו אנשי אמת (זוהר ח''ג קצ''ח) כי ב''ד עליון יקרא צדק, ואמרו ז''ל (ביצה ט''ז.) כי בראש השנה מזונותיו של אדם קבועים וכו', והנה כשיפול ההפרש על הממון בין אדם לחבירו ועמדו לפני השופט אם ישפוט על פי התורה אשר צוה ה' כשיזכו הראוי לזכות וגו' הנה הם שופטים המשפט עצמו ששפט ב''ד עליון הנקרא צדק, והוא אומרו ושפטו את העם משפט צדק פירוש ששפט בית דין העליון שנקרא צדק:

If we are to read the verse as a moral/ethical lesson we could apply a teaching based on what Moses said in Psalms 96,13: ישפט תבל בצדק, "God judges the universe with equity." Kabbalists (Zohar volume 3 page 198) understand the word צדק in this verse as referring to the Celestial Court. According to Beytzah 16 this court decides on Rosh Hashanah each individual's livelihood for the coming year. Accordingly, if a terrestrial judge decides between two litigants on the basis of Torah law they merely publicise a decision already made in the Celestial Court, as any decision not based on Torah law would upset the judgment made by the Celestial Court concerning this individual's livelihood. The words ושפטו את העם משפט צדק mean that these judges hand down to the people the decisions made by the Heavenly Tribunal.

ושפטו את העם משפט צדק. משפט של צדק, שיהיה המשפט דין נחתך, וכן כתוב (ויקרא י״ט:ט״ו) בצדק תשפוט עמיתך, וכמו שאמרו יקוב הדין את ההר, ואמר ר' עקיבא אין מרחמים בדין, ולכך אמר משפט צדק, שהרי לשון משפט הוא המצוע וענין בינוני, וזהו שכתוב (תהילים קי״ב:ה׳) יכלכל דבריו במשפט, (ירמיהו ל׳:י״א) ויסרתיך למשפט. וזה במדותיו של בשר ודם, אבל צדק האמור במדותיו של הקב"ה כולל דין ורחמים, ולכך אמר הכתוב (תהילים צ״ט:ד׳) משפט וצדקה ביעקב אתה עשית, כי משפט הוא קו אמצעי והוא מדתו של יעקב, ומזה אמר הכתוב (ירמיהו י׳:כ״ד) יסרני ה' אך במשפט אל באפך פן תמעיטני, הזכיר אך למעט חלק הדין שבו, ועל כן אמר יסרני ה' אך במשפט, כלומר בחלק החסד, אל באפך שהוא חלק הדין, פן תמעיטני, והבן היטב, כי צדק הוא מדת דינו של עולם דכתיב (תהילים ט׳:ט׳) והוא ישפוט תבל בצדק, מקבל ממדת הדין של מעלה הנקראת אלהים, וזהו שכתוב (שם נח) אך יש אלהים שופטים בארץ, וזהו סוד הכתוב הזה, שופטים כנגד אלהים שהוא מדת הדין של מעלה, ושוטרים הנצח וההוד, שעל ידם יוצאות הפעולות בעולם בדבר והפכו, לטוב או לרע, והכל נגמר ע"י צדק שהוא סוף הבנין, וזהו ושפטו את העם משפט צדק. ודרשו רז"ל משפט צדק מלמד שעושין צדקה עם שניהם, עם הזכאי שהוא נוטל את שלו ועם החייב שמוציאין גזלה מתחת ידו.

ושפטו את העם משפט צדק, “they shall judge the people with fair judgment.” This may be either a warning to the individual judge or to every individual Israelite not to appoint a judge who is not righteous as well as competent. If they fail to do so each Israelite will be an accessory to perversion of justice if and when it occurs.” The judgment is to be absolute. It is to correspond to Leviticus 15,15 בצדק תשפוט עמיתך, “you are to judge your fellow with righteousness.” Sanhedrin 6,2 phrased this as יקוב הדין את ההר, “let the judgment bore a hole into the mountain.” Rabbi Akiva adds that one does not mix mercy with justice (Ketuvot 84). [The aforementioned quotes mean that the time for possible arbitration is before a matter comes to court; once it has come to court only legal considerations are relevant. Ed.]. The word משפט implies something “in the middle,” i.e. a clear-cut decision between opposing claims. Compare Psalms 112,5: ”One conducts one's affairs with equity.” Jeremiah 30,11 speaks of ויסרתיך במשפט, “One will discipline you with justice.” These applications of strict yardsticks are valid in the dispensation of justice by a human tribunal.
The expression צדק which also appears in our verses is reserved for application by G’d. G’d combines both attributes when God sits in judgment. This is why we find David say in Psalms 99,4: משפט וצדקה ביעקב אתה עשית, “justice and charity You applied in judging Yaakov.” משפט is known in kabbalistic terms as the קו האמצעי the “middle” line on the diagram of the emanations, and Yaakov is the patriarch who represents this line [to the left of חסד on the right, Avraham’s attribute, and to the right of גבורה ,דין Yitzchak’s attribute. Ed.].
This enables us to understand Jeremiah 10,24: יסרני ה' אך במשפט, אל באפך פן תמיעטני, “chastise me o Lord, but in measure; not in Your wrath, lest You reduce me to naught.” The prophet says that the attribute of Justice which is part even of the tetragrammaton should not be applied to them as otherwise they would not survive the chastisement. [The prophet utters a prayer by their people who are aware that the enemy army is close to capturing Jerusalem. Ed]. משפט as distinct from דין, is perceived as the mild aspect of justice at work, whereas אפך is the harsh aspect of justice at work. Tzedek is the attribute of Justice applied to the world, as we know from Psalms 9,9 והוא ישפוט תבל בצדק, “and God will judge the universe by employing צדק.” This attribute receives its input from a higher source known as elohim. This is the meaning of Psalms 58,12 אך יש אלו-הים שופטים בארץ, “there is indeed divine justice on earth.” The word שופטים in that verse in Psalms and the word שופטים in our verse here are mystically linked together. The Torah’s instructions here are to establish the mechanism demonstrating that there is divine justice on earth. If it sounds as if justice is to be tempered with mercy in a court of law, this is misleading. The truth is if the guilty receives sentence the innocent is exonerated and feels that righteousness has been done for them whereas justice has been done to the other litigant.

שופטים ושוטרים תתן לך בכל שעריך כו' ושפטו את העם משפט צדק (דברים טו, יח). דהנה הקדוש ברוך הוא שופט את הכנסת ישראל בבוא יום המשפט בגודל רחמיו וחסדיו. אך צריכין אתערותא דלתתא לעורר את המדה של רחמנות למעלה. ועל ידי מה נתעורר אותו המדה של חסד, כשאנו למטה מתנהגים בחסד ולמדים זכות על כל איש מישראל לדונן לכף זכות ואז על ידי זה גם מלמעלה נתעורר אותו המדה ולמדין גם עליו וגם על כל זרע ישראל חסדים. ואם כן האדם מעורר בעובדא שלמטה השער העליון לפתוח שערי חסד להריק ברכה על כל זרע ישראל. וזה שכתוב שופטים ושוטרים תתן לך בכל שעריך, רוצה לומר שאתה בעצמך תתקן ותכין המשפט של מעלה על ידי שעריך, והוא השערים שלך שאתה עושה ומעורר במעשיך. וזהו ושפטו את העם משפט צדק, רוצה לומר כל איש ילמוד את עצמו להתנהג לשפוט את העם משפט צדק ללמד צדקה וזכות על כל זרע ישראל ואז האדם מעורר השער של מעלה ועל ידי זה יוצא בדין זכאי במשפט של מעלה, כי במדה שאדם מודד מודדין לו:

Deuteronomy 16,18. “Judges and law enforcers you ‎shall appoint in your “gates”‎‏ ‏‎ who will judge the people ‎fairly.”
While it is true, as we all know that G’d sits in ‎judgment of the people of Israel on New Year’s Day, at which ‎time God exercises God's love as well as God's mercy, there is still a need ‎for justice being meted out down here on earth by human, i.e. ‎mortal judges. The judges meting out justice on earth must also ‎reflect the attribute of Mercy employed in the celestial spheres. ‎When judges here on earth emulate the approach to the accused ‎displayed in the celestial spheres, i.e. to assume that even if ‎guilty, there are some excuses to be found for the conduct of the ‎accused, then we can hope that, by taking this into consideration, ‎our own judgment on New Year’s day will also reflect this ‎consideration shown to sinners who had fallen victim to the evil ‎urge.‎
From the above, it is clear that it is within our power, down ‎here on earth to ”open” the gates of loving kindness, the source ‎of G’d’s blessings for humankind. This is the reason that the Torah ‎linked the dispensation of fair justice to “all your gates.” The ‎Torah tells us that we ourselves must initiate the process of ‎justice by giving anyone who appears to commit a wrong the ‎benefit of the doubt, i.e. as the Talmud in Megillah 12 words ‎it: ”a person is measured by the yardsticks they apply to others.”‎

שופטים ושוטרים כו'. נראה לפרש ע"ד דאיתא בגמרא "צדיקים יצר טוב שופטן כו'", יש לומר הפירוש כי כן דרך הצדיקים שיש להם מוכיח בקרבם המוכיח אותם, על כל מעשיהם אשר הם עושים מוכיח אותם על פניהם ומראה להם גם במעשיהם הטובים איך שחסרו ולא עשאום כהלכתן כראוי לעשות להבורא יתעלה, וזהו "יצר טוב שופטן", ולא כן הרשעים, כי נהפוך הוא שכל מעשיהם טובים בעיניהם, וגם המעשים רעים שעשו מראה להם היצה"ר שטוב עשו, וזהו "יצר הרע שופטן", "בינונים זה וזה שופטן" כמו שאמר התנא "כגון אנו בינונים", דהיינו שאדם צריך להחזיק עצמו בשני דרכים האלו להתווכח בקרבו תמיד על מעשיו, שיהיה תמיד לנגד עיניו שהוא בעל חסרון שמחסר בעבודתו ית"ש ואינו יוצא ידי חובתו, בעשותו אחת ממצוות ה' יבין וישכיל היטב ויחשוב שלא עשאה ככל הצורך בצלילות וזכות כראוי להשם יתעלה ויהיה שפל ונבזה בעיני עצמו, אך אעפ"כ לא יחזיק עצמו כרשע ח"ו, כאמרם ז"ל "אל תהי רשע בפני עצמך", והטעם הוא כי אם ח"ו יחזיק עצמו כרשע, אזי אין לבו בקרבו לעשות איזה מצוה או תורה ותפילה ואיזה עובדא כשרה וישרה, כי מתייאש עצמו באומרו שאין ראוי לזה, ונמצא צריך האדם להחזיק בשני מדריגות יחדיו יהיו תמים אצלו, כאמרם ז"ל "בכל לבבך בשני יצריך", וזהו כגון אנו בינונים, ו"בינונים זה וזה שופטם".
Judges [shoftim] and Officers etc - we explain this through what is written in the Gemarah "the righteous are ruled [shoftan] by their inclination to good etc." (Berakhot 61b). The explanation is that the way of the righteous is that they have (internally) a rebuker that rebukes them on every action they take, it rebukes them on their faces and shows them that even in their good deeds how they are lacking, and how they did not do them appropriately (lit. according to the halakha) so as to do them for the sake of the Creator Praised Be, and this is "the impulse to do good rules them". This is not what happens to the evil ones, to whom all is upside down, since all their deeds are good in their eyes, and even the evil deeds they do the impulse to do evil shows them that they did a good thing, and this is "the impulse to do evil rules them." "Middling people are ruled by both", as the tanna says "like us, middling". That is, a person needs to strengthen oneself with these two ways, to always dispute internally regarding one's deeds, seeing oneself all the time as lacking in one's work (avodah, also worship) to the Holy One, and that one has not fulfilled one's obligation. As a person does one of the mitzvot of God, one needs to understand and comprehend very well that one did not do it with all the requirements regarding clearness (lucidity) and merit as fitting for Hashem The Praised, and then one will see oneself as humble and despised in one's eyes, and yet one should not, God forbid, hold oneself to be evil, because in that case one won't be able to have heart to do a mitzvah or [study] Torah or pray, and what would this be? A kosher and direct happening? [Of course not] One [in that case] despairs and says that one is not capable to do this. We find that a person needs to strengthen these two levels (intenally) together so they will be perfect within oneself, as the rabbis of blessed memory say "with all your hearts - with your two inclinations", and this is "like us, middling" and "middlings are ruled by both."
שופטים ושוטרים תתן לך בכל שעריך (דברים טז, יח). בכאן יש רמז מוסר להא דתנן בספר יצירה, שבעה שערים הם בנפש, שתי עינים, שתי אזנים, והפה, ושני נקבי האף, עד כאן לשונו. והוא חושב השערים שהם בראש של אדם. אמנם יש שער לברית המעור, וגם כן פה התחתון, וצריך האדם להיות שומר השערים דהיינו הראיה והשמיעה והדיבור והכעס היוצא מאף. ג"כ צריך לשמור שער ברית הקודש שלא יצא זרע כי אם לקדושה. גם פה התחתון שלא ימלא כריסו כבהמת קיא צואה. ועל אלו השערים ישים האדם לעצמו שופטים ושוטרים, כלומר שישפוט את עצמו תמיד. זהו תיבת לך שאמר תתן לך, וישגיח תמיד שלא יהיה שם שום עבירה, כי כמעט אלו המקומות מקום שלום, ויהיו תמיד בקדושה ובטהרה:

שופטים ושוטרים תתן לך בכל שעריך . We find an allusion here to the moral imperative quoted in the ספר יצירה that there are seven gateways to the soul (נפש). They are: The two eyes, the two ears, the mouth, and the two nostrils. Thus far the ספר יצירה. Only the gateways that are in person's head have been mentioned here. There are, however, two more "gateways," namely the opening from which seminal fluid is emitted, and the opening from which we excrete. A person has to guard these openings with extreme care. This "care" extends to what they see with their eyes, what they hear with their ears, what they say with their mouth, and the anger that they let escape from their nostrils. They also must exercise careful control over the gateway from the site of the Holy Covenant with G–d, making sure that any seminal fluid which one emits serves a sacred purpose. One must also ensure that one does not unnecessarily fill up the opening from which one excretes, as only animals keep on eating for the sake of eating, heedless of the amount of filth and vomit they accumulate within their bodies. In short, these are the שערים, gates of one's body, that a person must watch over like a judge and law enforcement officer. This is the reason the Torah added the words תתן לך, "place for yourself" in the opening verse of our portion.