3,886. Repairmen in the Mikdash

Hilchos Beis HaBechirah 7:23

There was a place in the loft that was opposite the Holy of Holies. It was only entered once every seven years, in order to see what repairs might be necessary. When contractors are needed to effect repairs in the Temple or to remove a source of ritual impurity, it’s a mitzvah to engage workers who are unblemished kohanim. If that’s not an option, then kohanim with disqualifying blemishes are the next best thing. If that’s not an option, Leviim should be engaged. If not, then Yisroelim. It’s a mitzvah to use ritually clean workers, but if that’s not an option then ritually unclean workers may be engaged. If the choice is between a worker who is a blemished kohein and one who is ritually unclean, they should use the one who is ritually unclean. This is because the rules against ritual impurity in the Temple are overridden in cases of communal need. The workmen who repair the Temple are lowered from the loft inside baskets. If baskets are unavailable or if their use is logistically impossible for some reason, the contractors may enter in the normal manner.

Hilchos Beis HaBechirah 8:1

There is a Torah obligation to guard the Temple. This is the case even when there’s no concern of enemies or robbers because guarding is a sign of respect. A palace with guards can’t be compared to one without.