Negative commandment · Lo Ta’aseh #78 of 613
That one impure should not enter the Temple mount
שלא יכנס טמא למחנה לויה שכנגדו לדורות הר הבית
The verse · Devarim 23:11
כִּי־יִהְיֶה בְךָ אִישׁ אֲשֶׁר לֹא־יִהְיֶה טָהוֹר מִקְּרֵה־לָיְלָה וְיָצָא אֶל־מִחוּץ לַמַּחֲנֶה לֹא יָבֹא אֶל־תּוֹךְ הַמַּחֲנֶה
“If there be among you any man, that is not clean by reason of uncleanness that chances by night, then shall he go abroad out of the camp, he shall not come within the camp:”
The Rambam’s words
For a person who is impure not to enter the camp of the Levites, the parallel for all time being the Temple Mount, as [Deuteronomy 23:11] states: "Do not enter the camp." This refers to the camp of the Levites.
שלא יכנס טמא למחנה לויה שכנגדו לדורות הר הבית, שנאמר "לֹא יָבֹא אֶל תּוֹךְ הַמַּחֲנֶה" (דברים כג, יא); זה מחנה לויה.
Why · Sefer HaChinuch #565
That one impure should not enter the Temple mount
“It is from the roots of the commandment [that it is] because it is known to the Sages that the matter of impurity weakens the power of the intellect and mixes it up and separates between it and the pure and perfect Elevated Understanding.”
Who & when
“And this commandment that one impure should not enter is practiced both by males and by females at the Temple Mount even in our days, and like the matter stated by the verse (Leviticus 26:31), “and make your holy places desolate” — and they, may their memory be blessed, expounded (Megillah 28a), “Their holiness is upon them even when they are desolate.””
Where in the Mishneh Torah
Hilchot Admission into the Sanctuary הלכות ביאת מקדש