The incident with Pinchas needs explanation. Many of the men from the tribe of Shimon were engaged in the sin of idol worship and immorality. A plague began that ended with the loss of 24,000.
Pinchas acted to end the plague with an act of zealotry. For some reason, Moshe had forgotten the Halacha as to how to act. Zimri, the head of the tribe of Shimon, sinned in public with Kozbi, a Midyanite princess. The Halacha is, קנאים פוגעים בו, that a zealot is allowed to strike them. Pinchas knew this and took his spear and killed both of them at the same time. This act succeeded in stopping the plague.
The idea of קנאות or zealotry, is a difficult one. For one to take the law into his own hands, as Pinchas did, requires great love for Hashem, and must be entirely לשם שמים, for the sake of Heaven. If the act is not done with complete sincerity, it is not קנאות, but a sin.
One other person in Tanach has קנאות connected with his name. This was Eliyahu Hanavi. He expressed his great love for Hashem and his willingness to act with zealotry on behalf of Hashem’s honor. Could this be why many opinions state that Pinchas was Eliyahu?