The Tanya describes mitzvot as drawing divine light into a person and the world, giving a chassidic framework for how a physical object like mezuzah can become a channel for holiness. While not about mezuzah specifically, it explains the spiritual purpose of physical mitzvot.
הִנֵּה עַל זֶה אָמְרוּ: ״בְּמָקוֹם שֶׁאַתָּה מוֹצֵא גְּדוּלָּתוֹ שֶׁל הַקָּדוֹשׁ־בָּרוּךְ־הוּא, שָׁם אַתָּה מוֹצֵא עַנְוְתָנוּתוֹ״, וְצִמְצֵם הַקָּדוֹשׁ־בָּרוּךְ־הוּא רְצוֹנוֹ וְחָכְמָתוֹ בְּתַרְיַ״ג מִצְוֹת הַתּוֹרָה וּבְהִלְכוֹתֵיהֶן, וּבְצֵרוּפֵי אוֹתִיּוֹת תּוֹרָה־נְבִיאִים־כְּתוּבִים, וּדְרָשׁוֹתֵיהֶן שֶׁבְּאַגָּדוֹת וּמִדְרְשֵׁי חֲכָמֵינוּ־זִכְרוֹנָם־לִבְרָכָה. בִּכְדֵי שֶׁכָּל הַנְּשָׁמָה אוֹ רוּחַ וָנֶפֶשׁ שֶׁבְּגוּף הָאָדָם, תּוּכַל לְהַשִּׂיגָן בְּדַעְתָּהּ, וּלְקַיְּימָן – כָּל מַה שֶּׁאֶפְשָׁר לְקַיֵּים מֵהֶן בְּמַעֲשֶׂה דִּבּוּר וּמַחֲשָׁבָה, וְעַל יְדֵי זֶה תִּתְלַבֵּשׁ בְּכָל עֶשֶׂר בְּחִינוֹתֶיהָ בִּשְׁלֹשָׁה לְבוּשִׁים אֵלּוּ.
—nevertheless, it is in this connection that it has been said: “Where you find the greatness of the Holy One, blessed is He, there you also find His humility.” For the Holy One, blessed is He, has compressed His will and wisdom within the 613 commandments of the Torah and in their laws, as well as within the combination of the letters of the Torah, the books of the Prophets and the Writings, and in the exposition thereof which are to be found in the Aggadot and Midrashim of our Rabbis of blessed memory. All this in order that each neshamah, or ruach, and nefesh in the human body should be able to comprehend them through its faculty of understanding, and to fulfill them, as far as they can be fulfilled, in act, speech, and thought, thereby clothing itself with all its ten faculties in these three garments.