The LORD said to Moses, “Take all the heads of the people and impale them before the sun to the LORD, so that the fierce anger of the LORD may turn away from Israel.” And Moses said to the judges of Israel, “Each of you slay his men who have joined themselves to Baal of Peor.” And behold, one of the sons of Israel came and brought close to his brothers a Midianitess, in the sight of Moses and in the sight of all the congregation of the Children of Israel, while they were weeping at the doorway of the tent of meeting.To whom does the phrase "and impale them" (ve-hoka otam) refer? Every commentator I have seen, from Rashi, Rashbam and ibn Ezra to Daat Miqra, understands it as referring to the unnamed sinners. Indeed, this is the conclusion of the Talmud (Sanhedrin 35a). Some translations insert this interpretation as well, from the New Living Translation's egregious "Seize all the ringleaders and execute them" (imparting some sort of pejorative meaning to the totally innocuous term roshei ha-am, heads of the people) to the Living Torah's unwieldy "'Take the people's leaders, and [have them] impale [the idolators] publicly," a sentence with enough brackets to hold up all the bookshelves in my den. According to this view, God tells them to convene courts, and Moses transmits this.
I find it amazing that the masters of peshat unanimously embrace this approach. It verges on the comical to imagine in the midst of a plague rounding up numerous judges, clerks, bailiffs, witnesses, etc. The Talmud itself, before it gets into the hermeneutics, has a working assumption that seems undeniable in the text, asking "If the people sinned, how did the people's heads sin?" Clearly, in this view, God is ordering Moses to publicly execute the leaders. (Indeed, the term "impaling" only shows up one other time in Scripture, in the punishment of Saul and his family for the crimes committed against the Gibeonites, II Samuel 21). This is indicated not only by the immediate antecedent in v. 4, but the fact that there has been no plural noun used as yet. "Israel" sins (in the singular), and the term "Children of Israel" only pops up in v. 6. It seems that Moses fails to execute God's command, the judges (who are identified as heads of the nation when appointed in Exodus and Deuteronomy) fail to execute Moses' command, and the plague is not halted until Phineas does exactly what God initially ordered: he runs a tribal leader through. (As we learn below, Kozbi's father has a similar title as well.)
This reading only gains more power when we consider that the "officers of hundreds and officers of thousands," along with Phineas, play a prominent role in the war with Midian (Numbers 31). These are the senior judges, the "heads" or "chiefs" described in both Ex. 18 and Deut. 1. They, more than anyone, should feel a need to expiate their sin, or "to atone for our lives," as they put it.