"It will be for him... a pact of priesthood because he took impassioned action for his God" Numbers 25:13
What to do with Pinchas? His model of religious action in killing Zimri and Cozbi is deeply disturbing, an apparent invitation to acts of zealotry. And yet it receives not merely approval, but the reward of a "pact of friendship", a divine promise of eternal priesthood.
This tension was as uncomfortable for the early sages as it is for us. They disapproved of religious zealotry but faced a dilemma: how to prevent it without challenging the model of Torah? How to express their unease at Pinchas's actions without contradicting the ruling of God?
Doing so required great creativity. While unable to explicitly prohibit acts such as that of Pinchas, the rabbis used halachic measures to ensure that his example could not be followed. As with the application of the death penalty generally (commanded by Torah; disapproved of by the rabbis), the sages created standards of proof and legal process that ensured we can admire Pinchas (if we must) but are unable, legally, to emulate him.
At the same time, the rabbis used their midrashic imagination to develop the Torah text, placing it outside of ordinary human experience. They embellished the acts of Zimri and Cozbi to take them beyond the pale and they added a divine helping hand. Midrash Numbers Rabbah speaks of twelve miracles enacted on Pinchas's behalf by God in his slaughtering of Zimri and Cozbi. This is help that potential zealots can not expect to receive.
The rabbis refused to treat biblical characters as simple role models; they understood the complexity of a loving relationship with Torah; and they refused to abdicate moral responsibility over a text with which they disagreed.