Pinchas’ taking out of Zimri and Cozbi, and Hashem’s extension of the Bris of Kehuna to him as a result, closes a chain of events that serve as a bookend to the 40-year galus in the midbar. We can surmise that the first chain was the series that started with Kivros HaTaava, the mergalim and the rebellion of Korach, which essentially leaves off just at the beginning of the 40 years lacuna in the Torah’s historical record.
This second chain begins also with a series of events that almost indicate that Bnei Yisrael are about to repeat their mistakes. In Chukas, culinary complaints lead to the snakebites, and possibly [if indirectly], Moshe Rabbeinu’s “waterloo”; in Balak, the incident at Shittim exacts a high toll averted only by Pinchas’ taking the law into his own hands figuratively and literally [albeit legitimately].
A closer examination of these parallel series may reveal how the nature of the process of Bnie Yisrael’s mission was about to change. One can contrast Pinchas with his grandfather Aharon, who stopped the plague in Korach [this, despite the fact that his personal status had been attacked] appeasing the Divine anger through a Divine service; here, the Divine response was elicited only when Pinchas took a more earthly response.
In a way, this may answer question about why the parshiyot of Balak and Pinchas are split right in the middle of Chapter 25: Rashi indicates that the surviving populace was not exactly thrilled with Pinchas’ action, even going as far as questioning his frumkeit [viz. the reference to Yisro]. The split between the parshiyot almost provides the dramatic moment where all of the backbiting occurred, but wasn’t recorded. This loosely parallels Bnei Yisrael’s immediate reaction to Korach’s demise [You have slain G-d’s nation!!!], which elicits a much more violent Divine response there.
We also see the ways in which attempting to use religion to “go negative” in a personal power struggles; close to the top [but apparently not close enough], both Korach’s and Zimri’s respective downfalls began with ostensibly religious power plays. Korach’s, of course, was much more involved: he buttressed his initial accusation of nepotism in the part of Moshe by using the parable of the poor woman suffering from the various agricultural matanos, the upshot being that Moshe and the rest of the Levites were enriching themselves at the populace’s expense. Zimri, by challenging Moshe to give him a heter to liaise with Kozbi [“Who gave you the heter for Tziporah?”], was probably trying to ensure that no one bothered him while he “conducted his business” [see my "Pinchas and Extremism" from last year which expounds on other theories regarding Zimri’s motivations, aside from just carnal lust.]
It probably takes until next week’s incident with Reuven, Gad, and Menashe assuring Moshe Rabbeinu that they are not repeating the sin of the Mergalim that we see that lessons might, finally, have been learned.