The 31st mitzvah is that we are commanded to remove from the Temple people who are tameh.
The source of this commandment is G‑d's statement1 (exalted be He), "Send out of the camp everyone who has a leprous mark or a male discharge, and all who are ritually defiled by the dead."
The camp referred to [in the desert] is the machaneh Shechinah, which in later generations corresponds to the Temple courtyard, as we explained in our commentary on the Mishneh, at the beginning of Seder Taharos.2 In the words of the Sifri, "The verse 'Send out of the camp' is a prohibition to those who are tameh, that they may not enter the Temple when still in a state of tumah."
This mitzvah is repeated in another form in G‑d's statement3 (exalted be He), "If a man is tameh because of a nocturnal emission, he must go outside the camp." The camp referred to in this phrase is the machaneh Shechinah, just as in [the passage quoted above as the source for] this same mitzvah,4 "Send them out of the camp." In tractate Pesachim,5 it is explained, "The verse 'he must go outside the camp' refers to the machaneh Shechinah." In the words of the Mechilta,6 "The verse 'Command the Jewish people to send out of the camp,' constitutes a positive commandment. What is the source for the prohibition? The verse, '[Send them out of the camp] and they shall not defile their camp.' "
The Sifra7 states, "The phrase 'he must go outside the camp' constitutes a positive commandment."