The gemara says in Tamid (26a) that cohanim and leviim are obligated to keep guard in the beis hamikdash both by day and also by night. The gemara says that we learn this from the passuk in Bamidbar that says (במדבר ג, לח):
וְהַחֹנִים לִפְנֵי הַמִּשְׁכָּן קֵדְמָה לִפְנֵי אֹהֶל מוֹעֵד מִזְרָחָה מֹשֶׁה וְאַהֲרֹן וּבָנָיו שֹׁמְרִים מִשְׁמֶרֶת הַמִּקְדָּשׁ לְמִשְׁמֶרֶת בְּנֵי יִשְׂרָאֵל
Those who camped in front of the mishkan to the east, before the Ohel Moed eastward, were Moshe and Aharon and his sons. They who watched the holy watch on behalf of the benei yisrael.
Moshe was a levi and Aharon and his sons were cohanim, so we see that leviim and cohanim have to guard the mishkan and the beis hamikdash.
The Raavad (Tamid 28a) asks:
היכי ילפינן ממשה ואהרון דכהנים ולויים בעי, הלא משה כהן גדול הוה כדאיתא בזבחים פרק טבול יום? י"ל אפילו למ"ד התם כהן גדול הוה מכל מקום לענין מראה נגעים לא היה כהן
How can we learn from the fact that the passuk says “מֹשֶׁה וְאַהֲרֹן” that cohanim and leviim are obligated to guard the beis hamikdash; was not Moshe a cohen gadol as the gemara says in Zevachim? (Moshe served as a cohen gadol during the שבעת ימי המילואים and also (according to some opinions) for the entire 40 years that the benei yisrael were in the midbar). If so we have no proof that someone who is only a levi has to keep guard in the beis hamikdash?
The Raavad answers that even according to the opinion that Moshe was a cohen gadol, nevertheless he was not able to inspect tzaraas (and declare it tameh or tahor). Since with regards to tzaraas Moshe was a levi and not a cohen we can deduce from the fact that Moshe had to guard the mishkan that leviim also have to keep guard.
The Binyan Halachah asks on the Raavad;
Since Moshe did have some of the dinim of a cohen, it would seem that you cannot prove from Moshe that someone who is not a cohen at all would have the same halachos. Maybe the reason that Moshe had to guard the mishkan was because he was similar to a cohen - in regards to the fact that he served as a cohen gadol - and not because he was similar to a levi - with regards to not being able to inspect tzaraas?
The Binyan Halachah explains the answer of the Raavad as follows:
The Rambam says in Hilchos Issurei Biah (19:10):
אבל חלל של תורה - הודאי - הרי הוא כזר, ונושא גרושה, ומטמא למתים, שנאמר אמור אל הכהנים בני אהרן אע"פ שהם בני אהרן עד שיהיו בכיהונם
A definite challal is like a zar (non-cohen) and he can marry a divorcee and he can become tameh to a dead person as the passuk says “אמור אל הכהנים בני אהרן” – even if they are the children of Aharon, the laws of cohanim do not apply to them until they are kosher cohanim.
This Rambam seems to be contradicted by another Rambam in Hilchos Bias Mikdash (6:10) where he says;
כהן שעבד ונבדק ונמצא חלל עבודתו כשירה לשעבר ואינו עובד להבא, ואם עבד לא חילל שנאמר ברך י"י חילו ופועל ידיו תרצה, אף חולין שבו תרצה
If a cohen did the avodah in the beis hamikdash and he was afterwards found to be a challal the avodah that he did is kosher but he should not continue doing the avodah. If he did go and do the avodah he has not profaned the avodah (and it is still kosher) as the passuk says “ברך י"י חילו ופועל ידיו תרצה” – “Hashem blessed his chalalim and was pleased with the work of his hands.”
We can see from this halachah that a challal is not a zar. The avodah of a challal is kosher bedieved, however the avodah of a zar is certainly not kosher bedieved. Therefore it would appear that a challal is considered to be at least a partial cohen. How then can the Rambam say that he is permitted to marry a divorced woman and become tameh because he is a zar?
The Binyan Halachah explains that there are two different aspects to the kedusha of cohanim:
- If a cohen is identified as a descendant of Aharon then he has the sanctity of the family of Aharon. This obligates him in certain mitzvos which are unique to the cohanim that were given to the descendants of Aharon who have the sanctity of Aharon, such as inspecting tzaraas, not becoming tameh and not marrying a divorcee.
- The cohanim are allowed to do the avodah in the beis hamikdash.
The mitzvos that relate to the kedushah of the kohanim were only ever given to Aharon and his descendants. They are unique to the cohanim and relate to the kedushah of Aharon’s family. The avodah on the other hand, did not originally belong to the cohanim; had the benei yisrael not served the egel hazahav then the bechorim would have done the avodah. The avodah was given to Aharon and his descendants as a reward and as an inheritance.
Therefore, regarding the mitzvos (such as not becoming tameh or marrying a divorcee) that were uniquely given to Aharon and his sons and that relate to their kedushas kehunah, the Rambam says that a challal is a zar. A challal is not considered to be fully a spiritual heir of Aharon and therefore he does not have the full kedushah of the mishpachas hacohanim. Subsequently the mitzvos that relate to the kedushah of Aharon’s family do not apply to him.
However the avodah was something that already existed before Aharon was appointed to be the kohen gadol at all. It was given as a reward to Aharon and his descendants. Therefore as long as the challal has some of the kedushah of the family of Aharon he inherits the right to do the avodah. (He should not do the avodah lechatchilah but bedieved his avodah is kosher.)
Moshe was the cohen gadol during theשבעת ימי המילואים , that means that he had the right to do the avodah during this time. We do not see from this that he had the full kedushah of the family of Aharon, as the degree of kedushah which is required to possess the right to do the avodah is less than the full kedushah of Aharon’s family.
Just as a challal has the kedushah to be able to do the avodah but does not have the kedushah that obligates him in the other mitzvos of the kohanim, such as being able to inspect tzaraas, so too Moshe had the level of kedushah that enabled him to receive the right to do the avodas kohen gadol but he was not given the full level of kedushah of Aharon that would have enabled him to inspect tzaraas and be obligated in the other mitzvos of the cohanim.
Therefore intrinsically Moshe remained a levi, not a cohen, and we can learn from the fact that he was obligated to guard the mishkan that other leviim too were obligated in this mitzvah.