Kehuna, or priesthood, was defined as descendants from Levi. But Pinchas, after he killed Cosbi and Zimri, was given Hashem’s “covenant of peace” and converted into a Cohen. Some of his descendants became Cohen Gadol, so in effect, Pinchas’ act of taking a spear and literally skewering sinners in the middle of public intercourse directly led to his descendants having the highest spiritual post among all Jews.
The key to understanding this sequence can be found in Hashem’s covenant of “peace” (shalom). The word “shalom” is written with a slash in the middle of the vav, making what is midrashically acceptable almost explicit in the text – the word “shalom”, peace, can also be read as “shalem”, whole, or complete.
The Torah uses the word “shalem” with respect to an individual to refer to when a defect has been corrected in someone’s character. For example, Yaakov is “shalem” after he wrestles with the angel, and appeases his brother, Esau. And Pinchas also, by the act of killing Zimri and Cosbi, has corrected a defect in himself. But what defect could possibly require such violent action?
The answer is found in Pinchas’ own history. Pinchas’ grandfather (through his mother) was Putiel, one of many names of Yisro himself. Yisro represented the ultimate form of non-Jewish spirituality – the Midrash says that he visited every idolatrous shrine in the world (Deut Rabbah I:5). More than that – he was an expert practitioner: (Eccl. Rabbah III:13): “For R. Ishmael learnt: Reuel, i.e. Yisro, did not omit a single form of idolatry in the world without turning to it and serving it.”
So Yisro represented all the spirituality to be had outside the Jewish people. Judaism has no lock on spirituality – we freely acknowledge the prophetic power of Bilaam, for example. We do not deny that there are holy, or even prophetic, people who are not Jewish. But we do believe that Judaism is not lacking any good spiritual elements.
And this is where Pinchas comes in. Pinchas, as Yisro’s grandson, brings with him his ancestry. Yisro’s spirituality is brought into Judaism through Pinchas – and not just as any Jew, but as a Cohen Gadol, as the ultimate “point man” between the Jewish people and G-d. Pinchas has value to bring to the Jewish people.
The problem with all the other forms of worship that existed outside of Judaism is that they had a heavy component of sexual impropriety (to put it mildly) as part and parcel of their rituals. What Judaism refers to as “gilui arayos” covers the entire gamut of these acts, but it boils down to a single essential kernel: Judaism recognizes that G-d is involved in the intimacy between husband and wife, as part of a loving, modest, and private act. All other sexual behavior is condemned as a misuse of the procreative desires that Hashem has given us – the rank physicality of such acts debases, instead of elevates, our bodies and souls.
When Pinchas spears Cosbi and Zimri, he is literally cutting out that part of himself. And by correcting this defect in himself, he becomes “shalem”, whole. His spirituality is then at the level where he and his descendants qualify to become Cohen Gadol. (This also explains why Pinchas is selected to lead the battle against Midian).