“And they shall guard the guarding of the tent of meeting!” (Bamidbar 18:4)
It is a positive commandment that the priests and levites must guard the temple and walk around it constantly during the day and the night. This applies all the way through the night as it says “And they shall guard the guarding of the tent of meeting!”. The aim of this guarding is to honor exalt and glorify the temple, not to guard against the fear of enemies. The method of this guarding is that the priests guard the inside and the Levites the outside and walk around it.
Amongst the roots of this commandment is that through the respect of the house people will come to treat it with awe, and when people come there to ask for atonement and forgiveness for their sins their hearts will melt and they will repent completely. It is part of the honor of the house that it should have guards like the great kings of the land.
Amongst the laws of this commandment are that Chazal said that there were twenty-four people guarding it every night in twenty-four different places. The priests kept guard in three places on the inside, and the Levites on the outside. There was one man appointed to go around the guards with lighted torches in front of him. He was called “The Temple-Mount man”, and any guard who did not stand up to greet him and say “Temple-Mount man, Peace be unto you!”, made it obvious that he was sleeping, and the man would hit him with his stick. He even had permission to burn the guard’s clothes, to the extent that people in Yerushalayim would say “What is that noise in the Courtyard? It is the sound of a Levite being beaten and his clothes being burnt, because he fell asleep during his watch!”.
This commandment applies to male priests and Levites, when the temple was standing, as they were separated for the commandment of guarding the temple.