Devarim / Deuteronomy 23:15
כִּי יְהוָה אֱלֹהֶיךָ מִתְהַלֵּךְ בְּקֶרֶב מַחֲנֶךָ לְהַצִּילְךָ וְלָתֵת אֹיְבֶיךָ לְפָנֶיךָ וְהָיָה מַחֲנֶיךָ קָדוֹשׁ וְלֹא־יִרְאֶה בְךָ עֶרְוַת דָּבָר וְשָׁב מֵאַחֲרֶיךָ׃
For the Eternal your Almighty walks in the midst of your camp, to save you and to give up your enemies before you. Therefore your camp shall be holy, so that He sees no shameful thing among you and turns away from you.
Pshat פְּשָׁט
As in the Temple
Shadal: the main thing is that the soldiers remember that the Eternal goes before them and salvation is from Him. The camp's cleanness is not for the ark and not for the air, but so that they stand in awe, as in the Temple. Rashbam thinks otherwise: the ark with the Torah went out with them to war. Rashi: "sees" — the Holy One, blessed is He.
How Shadal, Rashbam, and Rashi explain it
Remez רֶמֶז
With yud (י) and without
Kitzur Ba'al HaTurim: beside "shameful thing" stands "do not hand over" (תַסְגִּיר), a hint at what is enclosed (סְגוּרָה) behind glass. Minchat Shai: the word "your camp" appears twice in this verse: without the letter yud (י) and with it. Sefat Emet: the bad is "not seen in you" when it is worth nothing to a person.
How Kitzur Ba'al HaTurim, Minchat Shai, and Sefat Emet explain it
Drash דְּרָשׁ
Rabbi Pinchas's ladder
Midrash Tannaim draws from "your camp shall be holy" the ladder of Rabbi Pinchas ben Yair. Diligence leads to cleanness, cleanness to purity, purity to holiness, holiness to humility, then fear of sin, piety, the holy spirit. Each step is proven by a verse. And the first step is simply diligence.
How Midrash Tannaim explain it
Sod סוֹד
The holy point within
Sefat Emet: when a person prepares for a war for a good deed, the power of the soul helps him. A holy point is hidden in everyone. In struggle it opens and spreads through the whole body. On Shabbat a person receives an extra soul through rest, and on weekdays through war for the sake of Heaven.
How Sefat Emet explain it