Our Gemara on Amud Beis teaches us that a cohen must have precise knowledge of his lineage in order to serve in the Temple. This applies even if he is sure that he is a cohen. So long as he does not know his exact father, then he is invalid. The derivation comes from the verse:
״וְהָיְתָה לּוֹ וּלְזַרְעוֹ אַחֲרָיו״, בָּעֵינַן זַרְעוֹ מְיוּחָס אַחֲרָיו.
“And it shall be to him and to his seed after him, the covenant of an everlasting priesthood” (Numbers 25:13).
It is noteworthy that the verse that this halakha is derived from is actually speaking about Pinchas, after his courageous act of zealotry. The Gemara in Sanhedrin (82a) implies that Pinchas had to act out of outrage and wasn’t given explicit sanction or permission (See Ben Yehoyada ibid). It’s almost like the trope of the government agent going rogue, so that the State Department has plausible deniability. Moshe more or less said to Pinchas, “If you want to do this, you are on your own.”
Getting back to our Gemara’s derasha, I submit that the core idea is that for a Cohen to be a teacher and role model, he must have a strong grounding in his tradition. A man who does not know his father simply could not have absorbed enough of the Fifth Shulkhan Aruch, that is, the underlying sensitivities to serve as a role model, and certainly not a zealot who might have to act on the edge of the law. For someone to be a zealot like Pinchas and act on instincts, his instincts must be very good. That can only be cultivated in a person who has deep roots and a deep tradition that is not only in technicalities, but even subtle non-verbal cognitions, attitudes and perspectives.
Translations Courtesy of Sefaria, (except when, sometimes, I disagree with the translation .)