Justice Reveals Divine Mercy
אכן נראה עוד לבאר סמיכות הפרשיות ע"פ מ"ש במד' עשה צדקה ומשפט נבחר לה' מזבח זבחים בזמן המקדש דוקא ומשפט וצדקה בכל עת ע"ש
Indeed, it seems we can offer a further explanation for the juxtaposition of the parshiyos based on what is stated in the Midrash: "To do tzedakah and mishpat is more desirable to Hashem than a sacrifice" (Mishlei 21:3) — animal offerings can be brought only in the time of the Beis HaMikdash, but mishpat (justice) and tzedakah (righteousness) apply at every time; see there.
The Sfas Emes introduces a new way to understand why these parshiyos are placed next to each other, drawing on a Midrash that ranks tzedakah and mishpat above sacrifices, since they remain in force even after the Beis HaMikdash is gone.
וכמו שזכו לקבל פני השכינה במקדש ג"פ בשנה
And just as Bnei Yisrael merited to greet the Shechinah in the Beis HaMikdash three times a year,
Just as the Beis HaMikdash was a place where Bnei Yisrael came to encounter the Shechinah on the three festivals,
כמו כן ע"י משפט צדק כביכול השכינה שורה אצל הדיינים כמ"ש בקרב אלקים ישפוט
so too, through righteous judgment, the Shechinah rests, as it were, among the dayanim (judges), as it is written, "In the midst of the judges He judges" (Tehillim 82:1).
doing honest justice likewise draws the Shechinah down to rest among the judges, as the verse describes Hashem standing among them.
וכתי' חקיו ומשפטיו לישראל
And it is written, "His statutes and His judgments to Yisrael" (Tehillim 147:19).
He cites a verse that pairs Hashem's statutes with His judgments, both given to Bnei Yisrael.
חקיו הם המועדות כמ"ש חק לישראל הוא ודרשו חז"ל על קידוש החודש שהקב"ה מסכים עם הב"ד לקבוע ר"ח ומועדות
His statutes (chukav) are the Yamim Tovim, as it is written, "for it is a statute (chok) for Yisrael" (Tehillim 81:5), and Chazal expounded this regarding the sanctification of the new month — that the Holy One, Blessed is He, concurs with the Beis Din in establishing Rosh Chodesh and the Yamim Tovim.
The statutes refer to the Yamim Tovim, set by Beis Din's sanctification of the month, where Hashem ratifies whatever the court decides about the calendar.
וכמו כן מסכים עם משפט השופטים בצדק
And so too, He concurs with the just judgment of the judges.
In the very same way, Hashem ratifies and stands behind the just rulings of human judges.
ובמד' אל תהי מלגלג בדין שהוא א' מרגלי העולם
And in the Midrash: "Do not treat judgment lightly, for it is one of the three legs upon which the world stands."
He brings a Midrash warning against taking the act of judging lightly, since justice is one of the three foundations holding up the world.
פי' הגם שהדין הוא לכאורה היפך קיום העולם חסד יבנה
The explanation is: even though judgment (din) appears, on the surface, to be the opposite of the world's endurance — for "the world is built through chesed (kindness)" (Tehillim 89:3) —
At first glance din seems to contradict the world's survival, because the world is built and sustained by chesed, not by strict justice.
אבל אמרו כשיש דין למטה אין דין למעלה
nevertheless, Chazal said: when there is judgment below, there is no judgment above.
Yet Chazal teach that when proper judgment is done here below, the heavenly court does not need to bring judgment upon us.
וכשבנ"י עושין הדין בינם לבין עצמם בין א' לחבירו ומכ"ש כ"א בנפשו ששופט את עצמו לתקן דרכיו כמ"ש טובה מרדות א' בלבו של אדם
And when Bnei Yisrael carry out justice among themselves, between one and his fellow, and all the more so each person within his own soul — judging himself in order to rectify his ways, as it is stated, "A single self-reproach in a person's heart is better" (Berachos 7a) —
When Bnei Yisrael judge fairly between each other, and especially when a person honestly judges and corrects himself, that inner self-reproach is more valuable than outside rebuke.
אז הקב"ה מתמלא עליהם ברחמים וע"י הדין מתעורר הרחמים ואדרבא בזה נימתק מדה"ד
then the Holy One, Blessed is He, is filled with mercy upon them, and through the judgment, mercy is aroused; on the contrary, through this the attribute of strict judgment (middas hadin) is sweetened.
This self-judgment moves Hashem to mercy; the very act of din awakens rachamim and sweetens the harsh attribute of strict justice.
וכן הוא בצדקה כידוע
And so it is with tzedakah, as is known.
The same dynamic operates through tzedakah, as is well known.
וז"ש ויגבה ה"צ במשפט כי מתגלה מדת חסד ורחמים ע"י המשפט
This is the meaning of "And Hashem of Hosts is exalted through mishpat" (Yeshayahu 5:16) — for the attribute of chesed and rachamim (mercy) is revealed through justice.
This explains the verse that Hashem is exalted specifically through mishpat — because justice is precisely what reveals His chesed and mercy.
וז"ש מלך במשפט יעמיד ארץ כי אדרבא המשפט מקיים העולם:
And this is the meaning of "A king establishes the land through justice" (Mishlei 29:4) — for, on the contrary, mishpat sustains the world.
And it explains that a king sustains the land through justice — far from undermining the world, mishpat is what holds it up.
Summary: The Sfas Emes explains why the parshiyos of justice follow one another by showing that mishpat and tzedakah outlast even the Beis HaMikdash and its sacrifices, for through honest judgment the Shechinah comes to rest among the dayanim just as it rested in the Mikdash. Drawing a parallel to the sanctification of the new month, where Hashem ratifies Beis Din's rulings, he teaches that Hashem likewise stands behind the just rulings of judges. Though din appears to oppose a world built on chesed, Chazal teach that when there is judgment below there is no judgment above. When Bnei Yisrael judge fairly between themselves, and especially when each person judges and corrects himself, the very act of din awakens Hashem's rachamim and sweetens the attribute of strict justice. Thus mishpat does not threaten the world but reveals Hashem's chesed and sustains it, as in "A king establishes the land through justice."