The kohanim were commanded to perform Birkat Kohanim, but the blessing itself comes from God and does not depend on the righteousness of the kohanim. Therefore, even a kohen eats forbidden foods, has forbidden sexual relations, or commits other sins must perform Birkat Kohanim. If he does not perform it, he compounds his sin, as Rambam writes: “Do not tell an evil person, ‘Do more evil and refrain from performing mitzvot’” (MT, Laws of Prayer 15:6).
However, a kohen who has committed sins that mar his priestly status, such as marrying a divorcee or becoming contaminated by a corpse, is penalized by the Sages and forbidden him to perform Birkat Kohanim. Likewise, a kohen who worshipped idols or publicly desecrated Shabbat out of spite is deemed ineligible to perform Birkat Kohanim. However, if the kohanim who committed these sins repent completely, they may resume their priestly duties and perform the berakha (SA 128:37, 40-41; Peninei Halakha: Prayer 20:10).
A kohen who has killed may not perform Birkat Kohanim, as it is written: “When you spread your hands, I will turn My eyes away from you… your hands are full of blood” (Yeshayahu 1:15; Berakhot 32b). The kohen’s job is to increase kindness and life, like Aharon, who loved and pursued peace. A kohen who has killed has damaged the core of his priesthood. Thus, a kohen who unintentionally ran someone over with his car may not perform Birkat Kohanim. The poskim disagree about whether he may repent by fasting, tzedaka, and resolving not to sin again would enable him to once again perform Birkat Kohanim. In practice, a kohen who undergoes such a terrible experience must go to his rabbi to receive personal instruction about what to do (Peninei Halakha: Prayer 20:11).