The idolatrous nature of the Baal-Peor incident should shock the senses of those of us, who are G-d fearing today. We may easily ask, how could so many of the children of Israel fall prey to idolatry and licentiousness? Since this occurs after 38 years had passed from the time of the golden calf incident at Sinai, it can be inferred that the new generation had not guarded themselves against this enticing form of idolatry, nor fully learned from the mistakes of yesteryear.
Idolatry, whereof the “daughters of Moab” invited the Children of Israel to their feasts, designated for their g-ds, took rampant hold of B’nei Yisrael, and led towards immorality. How similar to the festivities that the previous generation took part in when worshiping the golden calf? Yet, Pinchas stood up, and took responsibility on his own by committing an act of zealousness. For this, he was rewarded with “a covenant of peace.”
Keep in mind, that those who had fallen prey to idolatry were executed at a makeshift tribunal, to meet the demands of the moment. While the plague still raged, an Israelite prince, Zimri took a Midianite princess, hand in hand, figuratively speaking, into his tent, in full view of the congregation. So, when Pinchas acted out of zealousness, by executing them on the spot, this may be viewed in light of the previous tribunal and executions.
Why a covenant of peace for such an aggressive act? Because he restored the Children of Israel, by reconciling them to G-d. As a result of his own zealousness, he took responsibility for the effrontery that ensued; and, definitively showed to all the people the sinfulness of the act. This would serve as an object lesson, of sorts, that would continue to make an impression on the people. Inasmuch that H’Shem awarded him with “a covenant of peace,” this shows that H’Shem approved of his act, because it was a swift response to a gross act of immorality that could have continued to run amuck; otherwise, Zimri’s immorality could have set a wrong example for the people, if it was not punished.