Sefer Bamidbar opened with the setup of the machaneh in the midbar. We then jump to a different array of topics -- sotah, nazir, birchas kohanim -- that seems out of place. About 10 years ago I posted the Ralbag's beautiful explanation that the Torah is working from the macro to the micro. First, it addresses the sanctity of the camp as a whole. We have the halachos of sending those who are tamei out of the camp. Then we turn to the family unit, and we have the parsha of sotah which is designed to restore shalom bayis. Finally, we have the kedusha of the individual, the greatest heights of which are realized by the nazir.
In the Sichos of R' Yissachar Meir from Yeshivat HaNegev he proposes that the entire parsha revolves around the one theme of kedushat ha'machaneh. The springboard for this approach comes from a question raised by Seforno on the parsha of gezel ha'ger. The Torah describes this sin as follows (5:6):
אִישׁ אוֹ אִשָּׁה כִּי יַעֲשׂוּ מִכׇּל חַטֹּאת הָאָדָם לִמְעֹל מַעַל בַּה׳
Why is theft called a מַעַל בַּה׳ when it is a sin bein adam l'chaveiro? Seforno comments:
כבר באה הקבלה (בבא קמא ק״ט.) שזה נאמר על גזל הגר, כי אמנם הגוזל אותו מחלל שם אלקיו בעיני הגר אשר בא לחסות תחת כנפיו. ולכן יקרא מועל בקדש, וחייב אשם כמשפט כל מועל בו.
The ger thinks he is joining am ha'nivchar and taking a step up in kedusha. Ripping him off is liable to make him question that assumption and even question his commitment. Is that what Judaism is all about? Is this how a holy nation behaves? The theft in this case leads to a chilul Hashem, מַעַל בַּה׳.
R' Yissachar Meir takes things in a bit of a different direction and suggests that the ganav fears being discovered by the police or his neighbors so he sneaks around to do his dirty work, but he has no fear of G-d seeing what he is doing. In his mind, G-d's presence is absent from the machaneh. This is his מַעַל בַּה׳.
That's why when there is no one else to return the theft to, the payment goes to the kohen. It's the kohen's job to bring about hashra'as haShechina, through his avodah in the Mikdash, through his teaching Torah. The tikun for failing to respect the presence of Hashem in the camp is to enable those who safeguard and reveal His presence to do their job.
In that same vein, he reads the parsha of sotah as not just about preserving shalom bayis between husband and wife, but about preserving standards of tzenius and kedusha in the machaneh as a whole. Immorality has to be rooted out because G-d is immanant.
R' Yisschar Meir does not quote it, but I think his approach helps explain a midrash later in our parsha. Commenting on the gift of the nasi of sheivet Yissachar, the Midrash writes:
קָרְבָּנוֹ קַעֲרַת כֶּסֶף אַחַת וגו׳ – בָּא נְשִׂיא שִׁמְעוֹן וְהִקְרִיב עַל סֵדֶר מַעֲשֶׂה הַמִּשְׁכָּן, וְלָמָּה הִקְרִיב קָרְבָּנוֹ כְּנֶגֶד מַעֲשֵׂה הַמִּשְׁכָּן, דּוּגְמַת מַעֲשֶׂה שִׁמְעוֹן אֲבִי הַשֵּׁבֶט, לְפִי שֶׁשִּׁמְעוֹן קִנֵּא עַל הַזְּנוּת וְהָרַג כָּל אַנְשֵׁי שְׁכֶם עַל שֶׁעִנּוּ דִּינָה אֲחוֹתוֹ, כְּמָה דְתֵימָא: וַיִּקְּחוּ שְׁנֵי בְנֵי יַעֲקֹב שִׁמְעוֹן וְלֵוִי אֲחֵי דִינָה אִישׁ חַרְבּוֹ וַיָּבֹאוּ עַל הָעִיר בֶּטַח וַיַּהַרְגוּ כָּל זָכָר וְאֶת חֲמוֹר וְאֶת שְׁכֶם בְּנוֹ הָרְגוּ לְפִי חָרֶב וַיִּקְחוּ אֶת דִּינָה מִבֵּית שְׁכֶם וַיֵּצֵאוּ (בראשית ל״ד:כ״ה-כ״ו). וְכֵן הַמִּשְׁכָּן הָיָה הוֹרֵג בַּנּוֹאֲפִים וּבַסּוֹטוֹת, כְּמָה דְּתֵימָא: וְלָקַח הַכֹּהֵן מַיִם קְדשִׁים בִּכְלִי חָרֶשׂ וּמִן הֶעָפָר אֲשֶׁר יִהְיֶה בְּקַרְקַע הַמִּשְׁכָּן וגו׳ (במדבר ה׳:י״ז), וְאוֹמֵר: וְהִשְׁקָה אֶת הַמַּיִם וְהָיְתָה אִם נִטְמְאָה וַתִּמְעֹל מַעַל וגו׳ (במדבר ה׳:כ״ז), וּלְכָךְ הִקְרִיב שְׁלֻמִיאֵל קָרְבָּנוֹ עַל סֵדֶר מַעֲשֶׂה הַמִּשְׁכָּן, זִכָּרוֹן לְמַעֲשֵׂה שִׁמְעוֹן. קָרְבָּנוֹ קַעֲרַת כֶּסֶף אַחַת וגו׳, קַעֲרַת, כְּנֶגֶד חֲצַר הַמִּשְׁכָּן שֶׁהָיָה מַקִּיף אֶת הַמִּשְׁכָּן כְּשֵׁם שֶׁהַיָּם מַקִּיף אֶת הָעוֹלָם.
שְׁלשִׁים וּמֵאָה מִשְׁקָלָהּ – כְּמָה דְּתֵימָא: אֹרֶךְ הֶחָצֵר מֵאָה בָאַמָּה (שמות כ״ז:י״ח), וְהַמִּשְׁכָּן שֶׁהָיָה בְּתוֹכוֹ שְׁלשִׁים אַמָּה אָרְכּוֹ, הֲרֵי מֵאָה וּשְׁלשִׁים
The Midrash goes on to connects all the elements of his gift to the Mishkan, e.g. פַּר אֶחָד בֶּן בָּקָר – כְּנֶגֶד יְרִיעוֹת הַמִּשְׁכָּן שֶׁהָיוּ שֶׁל מִינֵי צִבְעוֹנִין, and עִיר עִזִּים – כְּנֶגֶד הָאֹהֶל שֶׁהָיָה יְרִיעוֹת עִזִּים, etc.
If the parsha of sotah was just a matter between husband and wife, then what does that have to do with the construction of the Mishkan? True, וְכֵן הַמִּשְׁכָּן הָיָה הוֹרֵג בַּנּוֹאֲפִים וּבַסּוֹטוֹת, but is that really the essence of what the place is about? Hypothetically, if not for the korban mincha brought by the sotah, couldn't the entire ceremony just as well have taken place somewhere outside the Mishkan?
If we understand, as R' Yissachar Meir suggests, that the parsha of sotah is not just a personal matter between husband and wife but is really about preserving the sanctity of the machaneh, then the answer is clear. Bringing about and preserving the hashra'as haShechina in the machaneh is *exactly* what the function of the Mishkan is. The sotah ceremony is not incidental to the Mishkan, but is part of its very purpose.