Leviticus 22:2 "They shall separate themselves from the things which the children of Israel make holy to Me and they shall not profane My holy name"

The Torah defines certain situations in which all persons including priests may become impure, (see Introduction to Positive Mitzvah 74).

A priest who is impure is forbidden from serving in the Beit HaMikdash.