Devarim23: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.

Devarim 23:15

כִּי יְהוָה אֱלֹהֶיךָ

Devarim / Deuteronomy 23:15 · Drash

Devarim 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.

Drash דְּרָשׁ

Rabbi Pinchas's ladder

It would be nice to become holy at once. It does not happen that way: steps lead up to what is high, and the first one is quite simple.

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

Midrash Tannaim And turns away from you

Rabbi Natan says: let a person not turn his back to the Holy of Holies. As it says: "He has told you, man, what is good" (Michah / Micah 6:8).

Midrash Tannaim "And walk humbly with your Almighty."

From here Rabbi Pinchas ben Yair would say: diligence leads to cleanness, cleanness leads to purity, purity leads to holiness, holiness leads to humility, humility leads to fear of sin, fear of sin leads to piety, piety leads to the holy spirit, the holy spirit leads to the resurrection of the dead, the resurrection of the dead leads to Eliyahu (Elijah), of blessed memory.

Midrash Tannaim Diligence leads to cleanness

"And he finishes atoning" (Vayikra / Leviticus 16:20). Cleanness leads to purity: "and the kohen shall atone for her, and she shall be pure" (Vayikra / Leviticus 12:8). Purity to holiness: "and he shall purify it and sanctify it" (Vayikra / Leviticus 16:19). Holiness to humility: "For thus says the High and Exalted One, who dwells forever, and holy is His name" (Yeshayahu / Isaiah 57:15). Humility to fear of sin: "The consequence of humility is the fear of the Eternal" (Mishlei / Proverbs 22:4).

Rabbi Yitzchak ben Elazar said: what wisdom made a crown for its head, humility made a sole for its sandal. As it says: "The beginning of wisdom is the fear of the Eternal" (Tehillim / Psalms 111:10), and it is written: "The consequence (עֵקֶב) of humility is the fear of the Eternal."

Midrash Tannaim Fear of sin leads to piety

"Guard my soul, for I am pious" (Tehillim / Psalms 86:2).

Midrash Tannaim Piety leads to the holy spirit

"Then You spoke in a vision to Your pious ones" (Tehillim / Psalms 89:20). The holy spirit to the resurrection of the dead: "And I will put My spirit in you, and you shall live" (Yechezkel / Ezekiel 37:14).

Midrash Tannaim The resurrection of the dead leads to Eliyahu, of blessed memory

As it says: "Behold, I send you Eliyahu the prophet," and further: "and he shall turn the heart of the fathers to the children" (Malachi 3:23–24).

Takeaway

Rabbi Pinchas ben Yair was a sage of the Mishnah, son-in-law of Rabbi Shimon bar Yochai. His ladder is also in the Talmud (Avodah Zarah 20b), and later the book "The Path of the Just" (מְסִלַּת יְשָׁרִים) was built on it.
Rabbi Natan reads "and turns away" as a ban on turning one's back to the holy place.
עֵקֶב means both "consequence" and "heel." Rabbi Yitzchak ben Elazar hears both: the fear of the Eternal is the head of wisdom and the heel of humility. Humility stands above wisdom.
A bracket in the edition marks missing words, restored from the Jerusalem Talmud (Shabbat 1:3). The translation gives the restored text.