Another interpretation of "You shall not pervert justice" (Deuteronomy 16:19). This is a warning to the sage that he not seat beside himself one who is not fit for judgment; and if he did seat him, it is as though he had planted an Asherah, for adjacent to it is written, "You shall not plant for yourself an Asherah, any tree" (Deuteronomy 16:21). There was an incident concerning a certain man who had a lawsuit with one of the kings of the Hasmonean house. He came and stood before Simeon ben Shetah. He said to him, "I have a lawsuit against the king." Simeon ben Shetah said to those judges who were judging together with him, "If I send for the king, will you rebuke him?" They said to him, "Yes." He sent for him, and he came. They placed the throne beside Simeon ben Shetah. Simeon ben Shetah said to him, "Stand on your feet and submit to judgment." He said to him, "But does one judge the king?" He turned to his right, and the judges pressed their faces into the ground; he turned to his left, and they pressed their faces into the ground. The angel came and struck them down to the ground until their souls departed. At once the king trembled. Simeon ben Shetah said to him, "Stand on your feet and submit to judgment, for you are not standing before us, but before the One who spoke and the world came into being." At once he stood on his feet and submitted to judgment. From here we learn that litigants should conduct themselves with awe within themselves, as though, so to speak, they are being judged before the Holy One. For thus said Jehoshaphat to the judges, "Know what you are doing, for you do not judge for man but for the LORD" (II Chronicles 19:6). Said Rabbi Hama bar Hanina: Come and see! Were it not written in Scripture, it would be impossible to say it—that flesh and blood judges its Creator. The Holy One said to the judges: Conduct yourselves with awe within yourselves, as though you are judging Me. How so? A man performs a commandment before Me; I have decreed concerning him to give him a hundred fields. If you pass judgment against him in one of the things I decreed concerning him, I give him others of My own, and I reckon it against you as though you had taken it from Me.
Simeon ben Shetah Summons the Hasmonean King to Court
Midrash Tanchuma Buber, Shoftim 6:5
ד"א לא תטה משפט. אזהרה לחכם שלא יושיב אצלו מי שאינו ראוי לדין, ואם הושיב כאילו נטע אשרה, דסמיך ליה לא תטע לך אשרה כל עץ (דברים טז כא). מעשה באחד שהיה לו דין עם מלך ממלכי בית חשמונאי, בא ועמד לפני שמעון בן שטח, אמר ליה דין יש לי אצל המלך, אמר לם שמעון בן שטח לאותן הדיינין שהיו דנין עמו, אם משגר אני בשביל המלך, אתם מוכיחין אותו, אמרו לו הן, שיגר בשבילו, ובא נתנו את הכסא אצל שמעון בן שטח, אמר לו שמעון בן שטח עמוד על רגליך ותן את הדין, א"ל וכי דנין את המלך, פנה לימין וכבשו (את) הדיינין את פניהם בקרקע, פנה לשמאלו וכבשו את פניהם בקרקע, בא המלאך וחבטן בקרקע עד שיצתה נשמתן, מיד נזדעזע המלך, א"ל שמעון בן שטח עמוד על רגליך, ותן את הדין, כי לא לפנינו אתה עומד, אלא לפני מי שאמר והיה העולם, מיד עמד על רגליו, ונתן את הדין, מכאן שיהיו בעלי דינין נוהגין אימה בעצמן כביכול להקב"ה דנין, שכך אמר יהושפט לדיינין דעו [מה אתם עושים], כי לא לאדם תשפטו כי לה' (דה"ב יט ו), אמר ר' חמא בר חנינא בא וראה אילמלא מקרא כתיב אי אפשר לאומרו, שבשר ודם דן לבוראו, אמר הקב"ה לדיינין היו נוהגין אימה בעצמכם כאילו דנין אותי, כיצד אדם עושה מצוה לפני גזרתי עליו ליתן לו מאה שדות, אם אתה מעביר עליו את הדין באחת מה שגזרתי עליו, אני נותן לו אחרים משלי, ומעלה אני עליך כאילו ממני נטלת.