עבודה
הלכות ביאת מקדש
פרק ט

Halacha

הלכה א
זָר שֶׁעָבַד בַּמִּקְדָּשׁ עֲבוֹדָתוֹ פְּסוּלָה וְחַיָּב מִיתָה בִּידֵי שָׁמַיִם שֶׁנֶּאֱמַר (במדבר יח ז) "וְהַזָּר הַקָּרֵב יוּמָת" מִפִּי הַשְּׁמוּעָה לָמְדוּ שֶׁאֵין חִיּוּב זֶה אֶלָּא לְקָרֵב לַעֲבוֹדָה. וְהֵיכָן הִזְהִיר עָלָיו וְזָר לֹא יִקְרַב אֲלֵיכֶם. אֵי זֶהוּ זָר כָּל שֶׁאֵינוֹ מִזֶּרַע אַהֲרֹן הַזְּכָרִים שֶׁנֶּאֱמַר (ויקרא א ח) "וְעָרְכוּ בְּנֵי אַהֲרֹן". וְהִקְטִירוּ בְּנֵי אַהֲרֹן. בְּנֵי אַהֲרֹן וְלֹא בְּנוֹת אַהֲרֹן:
כסף משנה
1.
When a non-priest serves in the Temple, his service is invalid and he is liable for death at the hand of heaven, as [Numbers 18:7] states: "A non-priest who draws close will die." According to the Oral Tradition, we have learned that one does not become liable unless he draws close to perform service.1I.e., and it does not forbid merely entering the Temple or ascending the Altar. Where is the warning concerning this?2I.e., where is stated the prohibition for which this punishment is given? (Sifri) [Ibid.:4] states: "A non-priest shall not draw close to you."3Sefer HaMitzvot (negative commandment 74) and Sefer HaChinuch (mitzvah 390) include this prohibition among the 613 mitzvot of the Torah.
What is meant by a non-priest? Anyone who is not a male descendant of Aaron, as [Leviticus 1:8] states: "And the sons of Aaron shall arrange" and [Leviticus 3:8] states: "And the sons of Aaron shall set afire." [These service are performed by] "the sons of Aaron" and not the daughters of Aaron.4Thus restricting the priestly service to males and excluding females. The Radbaz questions why two verses are necessary to exclude the women of the priestly family. He explains that since they are permitted to partake of terumah and certain sacrificial foods, they are not entirely similar to Israelites. Hence, a second verse is necessary.

הלכה ב
אַף עַל פִּי שֶׁהַזָּרִים מֻזְהָרִין שֶׁלֹּא יִתְעַסְּקוּ בַּעֲבוֹדָה מֵעֲבוֹדוֹת הַקָּרְבָּנוֹת אֵין חַיָּבִין מִיתָה אֶלָּא עַל עֲבוֹדָה תַּמָּה לֹא עַל עֲבוֹדָה שֶׁיֵּשׁ אַחֲרֶיהָ עֲבוֹדָה. וְאֵין הַזָּר חַיָּב מִיתָה אֶלָּא עַל אַרְבַּע עֲבוֹדוֹת בִּלְבַד. עַל הַזְּרִיקָה וְעַל הַהַקְטָרָה וְעַל נִסּוּךְ הַמַּיִם בֶּחָג וְעַל נִסּוּךְ הַיַּיִן תָּמִיד:
כסף משנה
2.
Although non-priests are warned not to perform any of the services associated with offering sacrifices, they are liable for death [at the hand of Heaven] only for performing "complete service,"5Service which is the final stage in a sacrifice being brought to the altar (Yoma 24a). not on service that is followed by other service.6E.g., receiving the blood, carrying the blood or the limbs to the altar. [Thus] a non-priest is liable for death only for four services: a) sprinkling;7See Halachah 3. b) setting afire [sacrifices on the altar];8See Halachah 4. c) pouring water [on the altar] on Sukkot, and d) pouring wine on the altar at all times.

הלכה ג
כֵּיצַד עַל הַזְּרִיקָה. בֵּין שֶׁזָּרַק בִּפְנִים בֵּין שֶׁזָּרַק בַּחוּץ בֵּין שֶׁהִזָּה הַזָּאָה אַחַת מִכָּל הַזָּיוֹת הַדָּם בֵּין שֶׁהִזָּה הַזָּאָה אַחַת מִכָּל הַזָּיוֹת קָרְבְּנוֹת הַמְצֹרָע הֲרֵי זֶה חַיָּב מִיתָה:
כסף משנה
3.
How is one liable for sprinkling? Whether he dashed [blood] inside [the Temple building]9As performed by the High Priest on Yom Kippur and also when offering certain atonement offerings. or outside, [in the Temple Courtyard],10The sprinkling or dashing of blood on the external altar. performed one of the sprinklings of blood or performed one of the sprinklings of the sacrifices brought by a person afflicted with tzara'at,11See Hilchot Mechusrei Kapparah 4:2 where these sprinklings are mentioned. Rav Yosef Corcus questions why the water libations and the wine libations are considered as separate categories and the sprinkling of blood and oil are not. He explains that the two different libations stem from entirely different commandments. The sprinkling of the oil, by contrast, is not a commandment in its own right, but an ancillary element to the offering of a sacrifice and that sacrifice also involves sprinkling blood. Hence, the two are included in the mitzvah. he is liable for death.

הלכה ד
כֵּיצַד עַל הַקְטָרָה. הִקְטִיר אֵיבָרִים אוֹ קֹמֶץ אוֹ לְבוֹנָה עַל הַמִּזְבֵּחַ אֲפִלּוּ הָפַךְ בָּאֵיבָרִים שֶׁלֹּא נִתְעַכְּלוּ וְקֵרֵב שְׂרֵפָתָן חַיָּב מִיתָה וְהוּא שֶׁהִקְטִיר כְּזַיִת. וְכֵן אִם הִקְטִיר קְטֹרֶת עַל מִזְבַּח הַזָּהָב מִשֶּׁיַּקְטִיר כְּזַיִת חַיָּב. אֲבָל הַמַּקְטִיר קְטֹרֶת בְּיוֹם הַכִּפּוּרִים בְּקֹדֶשׁ הַקָּדָשִׁים אֵינוֹ חַיָּב מִיתָה עָלֶיהָ עַד שֶׁיַּקְטִיר מְלֹא חָפְנָיו שִׁעוּר הַמְפֹרָשׁ בַּתּוֹרָה:
כסף משנה
4.
How is one liable for setting afire [sacrifices on the altar]? Whether he set afire limbs [of animal sacrifices], a handful of flour, or of frankincense12I.e., entities that are usually set afire on the altar. on the altar - or even if he turned over limbs that had not been consumed by fire and hastened their being burnt,13As Sh'vuot 17b states, this applies even if the entity would have ultimately been consumed by fire without his activity, but his act hastens its consumption. he is liable for death, provided he set afire an olive-sized portion of these entities. Similarly, if one sets afire incense on the golden altar, when he sets afire an olive-sized portion,14For one to be liable, a portion of this minimum size is necessary, for an incense offering may not be smaller, as stated in Hilchot Issurei Mizbeiach 5:2. Hence, if he sets afire less, he is not performing service. Even though a larger amount of incense is offered each day, that is a Rabbinic enactment and not a Scriptural requirement (Radbaz). he is liable. In contrast, one who sets fire to incense on Yom Kippur in the Holy of Holies is not liable for death for this until he sets fire to a handful, for that is the measure explicitly [required] by the Torah.15Leviticus 16:12; Hilchot Avodat Kochavim 5:26. If he sets fire to a lesser amount, he is not performing service. Hence, he is not liable.

הלכה ה
וְהַמְסַדֵּר שְׁנֵי גִּזְרֵי עֵצִים עַל הַמַּעֲרָכָה הֲרֵי הוּא כְּמַקְטִיר אֵיבָרִים וְחַיָּב מִיתָה שֶׁהָעֵצִים קָרְבָּן הוּא. אֲבָל הַיּוֹצֵק וְהַבּוֹלֵל וְהַפּוֹתֵת וְהַמּוֹלֵחַ וְהַמֵּנִיף וְהַמַּגִּישׁ וּמְסַדֵּר אֶת לֶחֶם הַפָּנִים אוֹ אֶת הַבְּזִיכִין עַל הַשֻּׁלְחָן וְהַמֵּטִיב אֶת הַנֵּרוֹת וְהַמַּצִּית אֵשׁ בַּמִּזְבֵּחַ וְהַקּוֹמֵץ וְהַמְקַבֵּל דָּמִים. אַף עַל פִּי שֶׁנִּפְסְלוּ וַהֲרֵי הוּא מֻזְהָר עַל כָּל אֵלּוּ וְלוֹקֶה אֵינוֹ חַיָּב מִיתָה. מִפְּנֵי שֶׁכָּל אַחַת מֵהֶן עֲבוֹדָה שֶׁאַחֲרֶיהָ עֲבוֹדָה וְאֵינָהּ גְּמַר עֲבוֹדָה:
כסף משנה
5.
[A non-priest] who arranges two logs of wood on the altar's pyre is considered comparable to one who set [sacrificial] limbs afire and he is liable for death [at the hand of heaven for doing so]. For the wood is also considered as a sacrifice.16See Hilchot Ma'aseh HaKorbanot 14:1. Arranging these two logs is the final stage in the arrangement of wood on the altar. Hence a non-priest is liable (Radbaz).
In contrast, [a non-priest] who pours [oil onto the flour offerings], one who mixes [the flour offerings with oil],17Rabbi Akiva Eiger cites Hilchot Ma'aseh HaKorbanot 12:23 which states that the preliminary stages of the offering of a meal offering may be performed by a non-priest. one who breaks [the wafers of meal offerings] into pieces, one who salts [the sacrifices], one who waves [the sacrifices], one who brings [a meal offering] close to the altar, one who arranges the showbread or the bowls of incense on the [golden] table, one who prepares the lamps [of the Menorah],18See Halachah 7. one who kindles light on the altar, one who takes a fistful [of flour or incense], and one who receives the blood [of a sacrifice], even though he disqualifies his service, he is warned against doing so and is liable for lashes for doing so, he is not liable for death at the hand [of Heaven]. [The rationale is that] all of these services are followed by another service and they do not represent the completion of the offering [of a given sacrifice].

הלכה ו
שְׁחִיטַת הַקָּדָשִׁים כְּשֵׁרָה בְּזָרִים אֲפִלּוּ קָדְשֵׁי קָדָשִׁים. בֵּין קָדְשֵׁי יָחִיד בֵּין קָדְשֵׁי צִבּוּר שֶׁנֶּאֱמַר (ויקרא א ה) "וְשָׁחַט אֶת בֶּן הַבָּקָר לִפְנֵי ה' וְהִקְרִיבוּ בְּנֵי אַהֲרֹן" מִקַּבָּלָה וְאֵילָךְ מִצְוַת כְּהֻנָּה. וְכֵן הַהֶפְשֵׁט וְהַנִּתּוּחַ וְהוֹלָכַת עֵצִים לַמִּזְבֵּחַ כְּשֵׁרָה בְּזָרִים שֶׁנֶּאֱמַר בָּאֵיבָרִים (ויקרא א ט) "וְהִקְטִיר הַכֹּהֵן אֶת הַכּל הַמִּזְבֵּחָה" זוֹ הוֹלָכַת אֵיבָרִים לַכֶּבֶשׁ. הוֹלָכַת אֵיבָרִים הִיא שֶׁצְּרִיכָה כְּהֻנָּה וְלֹא הוֹלָכַת עֵצִים:
כסף משנה
6.
The slaughter of sacrificial animals is acceptable if performed by non-priests.19See also Hilchot Ma'aseh HaKorbanot 5:1; Hilchot Pesulei HaMukdashim 1:1. [This applies even to] sacrifices of the most holy order, both individual sacrifices and communal sacrifices, as [Leviticus 1:5] states: "And he shall slaughter the bull before God and the sons of Aaron shall offer it." Implied is that from receiving [the blood], the mitzvah belongs to the priesthood. Similarly, skinning an animal, cutting it up, and bringing wood to the altar are acceptable when performed by non-priests, for with regard to the limbs, [ibid.:9] states: "And the priest shall set afire everything on the altar," this refers to bringing limbs [from sacrificial animals] to the [altar's] ramp. [We may infer that] bringing such limbs requires a priest, but not bringing wood.

הלכה ז
וְכֵן הַדְלָקַת הַנֵּרוֹת כְּשֵׁרָה בְּזָרִים לְפִיכָךְ אִם הֵטִיב הַכֹּהֵן אֶת הַנֵּרוֹת וְהוֹצִיאָן לַחוּץ מֻתָּר לְזָר לְהַדְלִיקָן:
כסף משנה
7.
Similarly, the kindling of the lamps [of the Menorah] is acceptable20Even as an initial preference (Radbaz). The Ra'avad differs and maintains that, after the fact, if a non-priest kindled the lamps, it is valid, but as an initial preference, he is not allowed to kindle them. The Radbaz brings support for the Rambam's position from Yoma 24b which states that kindling the lamps of the Menorah is not an act of service. Since it is not an act of service, asks the Radbaz, why should a non-priest be restricted from performing it? How is it different from the slaughter of an animal?
The Minchat Chinuch (mitzvah 98) reinforces the Ra'avad's question, asking how is it possible for the Menorah to be lit outside its proper place? The Rambam LeAm explains that the mitzvah is not lighting the lamps, but rather putting the lamps in their place.
if performed by a non-priest. Therefore, if a priest cleaned the lamps and brought them outside,21I.e., out from the Temple building to a place in the courtyard where a non-priest is allowed to stand. Note the discussion of the meaning of the term hatavah in Hilchot Temidim UMusafim 3:12 and notes. a non-priest is permitted to kindle them.

הלכה ח
הֲרָמַת הַדֶּשֶׁן צְרִיכָה כֹּהֵן שֶׁנֶּאֱמַר (ויקרא ו ג) "וְלָבַשׁ הַכֹּהֵן מִדּוֹ בַד" וְגוֹ'. וְאִם הֵרִים יִשְׂרָאֵל לוֹקֶה וְאֵינוֹ חַיָּב מִיתָה אַף עַל פִּי שֶׁאֵין אַחֲרֶיהָ עֲבוֹדָה שֶׁנֶּאֱמַר עֲבֹדַת מַתָּנָה (במדבר יח ז) "עֲבוֹדַת מַתָּנָה" הוּא שֶׁתִּהְיֶה בְּכֹהֵן לְבַדּוֹ וְאִם קָרַב לָהּ הַזָּר חַיָּב מִיתָה. אֲבָל עֲבוֹדַת סִלּוּק אֵין חַיָּבִין עָלֶיהָ מִיתָה. [וְכֵן אִם דִּשֵּׁן מִזְבֵּחַ הַפְּנִימִי וְהַמְּנוֹרָה אֵינוֹ חַיָּב מִיתָה]:
כסף משנה
8.
The removal of the ashes [from the altar] must be performed by a priest,22See ibid. 2:10. as [Leviticus 6:3] states: "And the priest will put on his linen fit tunic...." If an Israelite removes [the ash], he is liable for lashes.
He is not liable for death [at the hand of Heaven] even though this is a service that is not followed by another service.23See Halachah 2. [This is derived as follows. The verse that speaks of the punishment of death at the hand of Heaven, Numbers 18:7,] speaks of "work of giving."24I.e., the verse has two connotations: a) that the priestly service is a gift to the priests, b) (and this is the focus here), that the priestly service involves giving: offering sacrificial substances on the altar. [Implied is that] the work of giving must be performed by a priest alone. If a non-priest offered [a sacrifice], he is liable for death. The service of removal25I.e., the removal of the ashes. does not make a non-priest liable for death. Similarly, if a non-priest cleaned the inner altar or the Menorah, he is not liable for death.

הלכה ט
סִדֵּר הַמַּעֲרָכָה פּוֹרְקָהּ וְחוֹזֵר הַכֹּהֵן וְסוֹדְרָהּ מִפְּנֵי שֶׁסִּדּוּרָהּ פָּסוּל:
כסף משנה
9.
[If a non-priest] arranged the wood on the altar, the arrangement should be taken apart and rearranged by a priest, because the [initial] arrangement is unacceptable.26Because arranging the wood is considered sacrificial service (Radbaz). The Kessef Mishneh points out that from Yoma 27-28a, one might conclude that it is permitted for a non-priest to arrange the wood of the altar. Nevertheless, according to the Rambam that passage only absolves a non-priest from the punishment of death. It does not grant him permission to arrange the wood.

הלכה י
הַטָּמֵא וּבַעַל מוּם וְשֶׁלֹּא רָחוּץ יָדַיִם וְרַגְלַיִם שֶׁשִּׁמֵּשׁ בַּמִּקְדָּשׁ אֵינָן חַיָּבִין אֶלָּא עַל עֲבוֹדוֹת שֶׁהַזָּר חַיָּב עֲלֵיהֶן מִיתָה. וְעַל שְׁאָר הָעֲבוֹדוֹת בְּאַזְהָרָה:
כסף משנה
10.
An impure [priest], one with a disqualifying physical blemish, and one who did not wash his hands or feet27The commentaries question why the Rambam omits a priest who does not wear the priestly garments. Rav Yosef Corcus explains that it is not necessary to mention such a person because in Hilchot K'lei HaMikdash 10:4, the Rambam stated that a priest who does not wear the priestly garments is considered as a non-priest. are not liable28I.e., each one is liable according to the punishment appropriate for him. An impure priest and one who did not wash his hands and feet are liable for death and one who is physically blemished is liable for lashes (Kessef Mishneh). except for services that a non-priest is liable for death.29I.e., services that are not followed by other services which involve giving. For other services, he [violates merely] a warning.

הלכה יא
כֹּהֵן טְבוּל יוֹם וּמְחֻסַּר כִּפּוּרִים שֶׁנִּטְמָא וַהֲרֵי הוּא מְחֻסַּר בְּגָדִים וְשֶׁלֹּא רָחוּץ יָדַיִם וְרַגְלַיִם וְעָבַד חַיָּב עַל כָּל אֶחָד וְאֶחָד. וְאִם הָיָה זָר אֵינוֹ לוֹקֶה אֶלָּא אַחַת מִשּׁוּם זָרוּת:
כסף משנה
11.
A priest who immersed that day30And must wait until the evening before performing service. who is lacking atonement,31E.g., a person afflicted with tzara'at who must bring an atonement offering before serving. who became impure,32With another type of impurity. who did not wash his hands and feet and yet served [in the Temple] is liable for each transgression.33Since he violated many prohibitions with one act of service, he is liable for a sacrifice for each violation.
The Ra'avad cites a Tosefta that does not accept the Rambam's ruling on this point and instead, maintains that he is liable for only one sacrifice. The Radbaz and the Kessef Mishneh, however, support the Rambam's ruling, explaining that each of the prohibitions expands the scope of the obligation. See Hilchot Issurei Bi'ah 7:2 and Hilchot Ma'achalot Assurot 8:6 which discusses the ground rules for these concepts.
If he was a non-priest,34Even if he also possessed all the other disqualifying factors. he is liable for lashes only for serving as a non-priest.35For all of the other prohibitions were given only to a priest. They do not apply to a non-priest (Kessef Mishneh).

הלכה יב
זָר שֶׁשִּׁמֵּשׁ בְּשַׁבָּת חַיָּב מִשּׁוּם שַׁבָּת וּמִשּׁוּם זָרוּת. וְכֵן בַּעַל מוּם שֶׁשִּׁמֵּשׁ בְּטֻמְאָה חַיָּב מִשּׁוּם טֻמְאָה וּמִשּׁוּם בַּעַל מוּם:
כסף משנה
12.
When a non-priest performs [Temple] service on the Sabbath, he is liable for violating the Sabbath laws36For the Temple services involve performance of forbidden labors. These prohibitions are superseded by the obligation to offer the sacrifices, but since a non-priest's service is not valid, he is considered as liable for these prohibited acts. and for serving as a non-priest.37Here also although a single act is performed, since two different prohibitions are involved, he is liable for both of them. We do not follow the principle: One prohibition does not fall on another prohibition, because the prohibition against performing the Sabbath labors is greater in scope, encompassing other acts besides the Temple service. Similarly, when a priest with a physical blemish serves while ritually impure, he is liable [both] for [serving] while impure and for serving with a blemish.38For the ritual impurity increases the scope of his liability, making him liable also for entering the Temple and partaking of sacrifices. Since it is of a greater scope, we do not follow the principle, one prohibition does not fall on another (Radbaz).

הלכה יג
כָּל כֹּהֵן שֶׁעָבַד עֲבוֹדָה זָרָה בֵּין בְּמֵזִיד בֵּין בְּשׁוֹגֵג אַף עַל פִּי שֶׁחָזַר בִּתְשׁוּבָה גְּמוּרָה הֲרֵי זֶה לֹא יְשַׁמֵּשׁ בַּמִּקְדָּשׁ לְעוֹלָם שֶׁנֶּאֱמַר (יחזקאל מד יג) "וְלֹא יִגְּשׁוּ אֵלַי לְכַהֵן לִי". אֶחָד הָעוֹבֵד אוֹתָהּ בְּשֵׁרוּת כְּגוֹן שֶׁנַּעֲשָׂה כֹּמֶר לַעֲבוֹדָה זָרָה אוֹ הַמִּשְׁתַּחֲוֶה לָהּ אוֹ הַמּוֹדֶה בָּהּ וְקִבְּלָהּ עָלָיו בֶּאֱלוֹהַּ הֲרֵי זֶה פָּסוּל לְעוֹלָם. עָבַר וְהִקְרִיב אֵין קָרְבָּנוֹ רֵיחַ נִיחוֹחַ אַף עַל פִּי שֶׁהָיָה שׁוֹגֵג בְּעֵת שֶׁשֵּׁרֵת אוֹ שֶׁהִשְׁתַּחֲוָה אוֹ שֶׁהוֹדָה. אֲבָל הַשּׁוֹחֵט לַעֲבוֹדָה זָרָה בְּשׁוֹגֵג אִם עָבַר וְהִקְרִיב קָרְבָּנוֹ רֵיחַ נִיחוֹחַ וְנִתְקַבֵּל שֶׁהֲרֵי לֹא שֵׁרֵת וְלֹא נַעֲשָׂה כֹּמֶר אֶלָּא שָׁחַט בִּלְבַד וְהוּא שׁוֹגֵג וְאַף עַל פִּי כֵן לְכַתְּחִלָּה לֹא יַעֲבֹד:
כסף משנה
13.
Any priest who served a false deity, whether willingly or inadvertently - even if he repented completely - may never serve in the Temple,39A parallel also exists with regard to the recitation of the priestly blessing. See Hilchot Nesiat Kapayim 15:3. There the Rambam also excludes a priest who was compelled to serve idols and he cites a different prooftext, II Kings 23:9. as [Ezekiel 44:13] states: "They40The priests who "who distanced themselves from Me during Israel's straying, when they strayed after false deities" (Ezekiel 44:10 . shall not draw near to Me, to serve Me." [This prohibition applies] whether [a priest] serves the false deity in its rites, e.g., he became a priest to the false deity, he bowed down to it, or acknowledged its [divinity] and accepted it as god. [In all these instances,] he is disqualified [to serve in the Temple] forever.
If [such a priest] transgressed and performed service, his sacrifice is not considered as a pleasing fragrance41I.e., though it is not disqualified, it is not considered as desirable. even if he acted inadvertently when he served, bowed down to, or acknowledged [the false deity]. If, by contrast, one slaughtered an animal for a false deity inadvertently and then transgressed and offered a sacrifice [in the Temple], the sacrifice is considered a pleasing fragrance and is accepted, for he did not perform service for the false deity or become its priest; all he did was slaughter an animal for it42Note a parallel in Hilchot Shechitah 2:15. and that was performed inadvertently. Nevertheless, as an initial preference, he should not perform service [in the Temple].

הלכה יד
מִי שֶׁעָבַר וְעָשָׂה בַּיִת חוּץ לַמִּקְדָּשׁ לְהַקְרִיב בּוֹ קָרְבָּנוֹ לַשֵּׁם אֵינוֹ כְּבֵית עֲבוֹדָה זָרָה וְאַף עַל פִּי כֵן כָּל כֹּהֵן שֶׁשִּׁמֵּשׁ בְּבַיִת כָּזֶה לֹא יְשַׁמֵּשׁ בַּמִּקְדָּשׁ לְעוֹלָם. וְכֵן כֵּלִים שֶׁנִּשְׁתַּמְּשׁוּ בָּהֶן שָׁם לֹא יִשְׁתַּמְּשׁוּ בָּהֶן בַּמִּקְדָּשׁ לְעוֹלָם אֶלָּא יִגָּנְזוּ. וְיֵרָאֶה לִי שֶׁאִם עָבַד כֹּהֵן שֶׁשִּׁמֵּשׁ שָׁם בַּמִּקְדָּשׁ לֹא פָּסַל:
כסף משנה
14.
If one transgressed and built a shrine outside the Temple and offered a sacrifice to God there,43The Rambam is not speaking about a mere hypothetical situation. As he relates in his Commentary to the Mishnah (Menachot 13:10), Chonio, the son of Shimon the Just entered into a power struggle with his brother Shimi to inherit his father's position as High Priest. Chonio incurred the people's wrath, because he brought about a very deprecating situation in the Temple. He fled to Alexandria where he established a following, constructed a temple to God resembling the Temple in Jerusalem, and offered sacrifices there just like those offered in Jerusalem. Needless to say, our Sages shunned Chonio's shrine, because its sacrificial worship violated the prohibition against offering sacrifices outside the Temple. Indeed, the majority of those who worshiped there were non-Jewish Egyptians whom Chonio had attracted to God's service. it is not considered as a Temple to a false deity. Nevertheless, any priest who serves in such a shrine should never serve in the Temple. Similarly, utensils that were used there should never be used in the Temple. Instead, they should be entombed. It appears to me44This represents a conclusion reached by the Rambam on the basis of deduction without a prior Rabbinic source. that if a priest who served in such [a shrine] performs service in the Temple, it does not invalidate it.45Since they were disqualified by Rabbinic decree, after the fact, their service is acceptable (Kessef Mishneh).

הלכה טו
נִמְצְאוּ כָּל הַפְּסוּלִין לַעֲבוֹדָה שְׁמוֹנָה עָשָׂר וְאֵלּוּ הֵן. הָעוֹבֵד עֲבוֹדָה זָרָה. הַזָּר. בַּעַל מוּם. הֶעָרֵל. הַטָּמֵא. טְבוּל יוֹם. מְחֻסַּר כִּפּוּרִים. הָאוֹנֵן. הַשִּׁכּוֹר. מְחֻסַּר בְּגָדִים. יָתֵר בְּגָדִים. פְּרוּם בְּגָדִים. פְּרוּעַ רֹאשׁ. שֶׁלֹּא רָחַץ יָדַיִם וְרַגְלַיִם. הַיּוֹשֵׁב. מִי שֶׁיֵּשׁ בֵּין יָדוֹ וּבֵין הַכְּלִי דָּבָר חוֹצֵץ. מִי שֶׁיֵּשׁ בֵּין רַגְלוֹ וּבֵין הָאָרֶץ דָּבָר חוֹצֵץ. מִי שֶׁעָבַד בִּשְׂמֹאלוֹ. כָּל אֵלּוּ פְּסוּלִין לַעֲבוֹדָה וְאִם עָבְדוּ חִלְּלוּ. חוּץ מִפְּרוּעַ רֹאשׁ וּקְרוּעַ בְּגָדִים וְהַשּׁוֹחֵט לַעֲבוֹדָה זָרָה בְּשׁוֹגֵג. שֶׁאִם עָבְדוּ עֲבוֹדָתָן כְּשֵׁרָה:
כסף משנה
15.
Thus there are eighteen factors that disqualify [a person] from serving [in the Temple]. They are: a) one who served a false deity;46Halachah 13. b) a non-priest;47Halachah 1. c) one with a disqualifying physical blemish;48Chapter 6, Halachot 1-2. d) one who is uncircumcised;49Ibid.:8. e) one who is impure;50Chapter 4, Halachah 1. f) one who immersed that day [and must wait until nightfall to become pure];51Ibid.:4. g) one who is lacking atonement;52Ibid.:5. h) one who is in a state of acute mourning;53Chapter 2, Halachah 7. i) one who is intoxicated;54Chapter 1, Halachah 1. j) one who is lacking the priestly garments;55Hilchot K'lei HaMikdash 10:4. k) one who is wearing extra garments;56Ibid.:5. l) one whose garments were torn;57Chapter 1, Halachah 14. m) one whose hair has grown long;58Ibid.:8-9. n) one who did not wash his hands and feet;59Chapter 5, Halachah 1. o) one who sits;60Ibid.:17. p) one who had an entity intervening between his hand and the sacred utensil [he is using];61Ibid. q) one who had an entity intervening between his foot and the earth;62Ibid. r) one who served with his left hand.63Ibid.:18.
All of the above are disqualified from serving and if they serve, they invalidate their service with the exception of those with long hair, those with torn garments, and one who slaughtered for a false deity inadvertently. If these individuals serve, their service is acceptable.

עבודה הלכות ביאת מקדש פרק ט
Avodah Bi`as HaMikdash Chapter 9