Bamidbar31:50

וַנַּקְרֵב אֶת־קָרְבַּן יְהוָה אִישׁ אֲשֶׁר מָצָא כְלִי־זָהָב אֶצְעָדָה וְצָמִיד טַבַּעַת עָגִיל וְכוּמָז לְכַפֵּר עַל־נַפְשֹׁתֵינוּ לִפְנֵי יְהוָה׃

And we have brought the Eternal's offering, what each man found of articles of gold: armlets, and bracelets, rings, earrings, and pendants, to make atonement for our souls before the Eternal."

Bamidbar 31:50

וַנַּקְרֵב אֶת־קָרְבַּן יְהוָה

Bamidbar / Numbers 31:50 · Pshat

Bamidbar 31:50

וַנַּקְרֵב אֶת־קָרְבַּן יְהוָה אִישׁ אֲשֶׁר מָצָא כְלִי־זָהָב אֶצְעָדָה וְצָמִיד טַבַּעַת עָגִיל וְכוּמָז לְכַפֵּר עַל־נַפְשֹׁתֵינוּ לִפְנֵי יְהוָה׃

And we have brought the Eternal's offering, what each man found of articles of gold: armlets, and bracelets, rings, earrings, and pendants, to make atonement for our souls before the Eternal."

Pshat פְּשָׁט

Atonement after victory

The war is over, and not one soldier has fallen. And just now the officers bring a gift "to atone for our souls". The commentators ask what they needed atonement for.

Rashi: the ornaments of the Midyanite women atone for the thoughts of the heart. Chizkuni: before the soldiers were counted they made a vow, so that no plague would strike them, as with the census in the wilderness. Sforno: atonement for not stopping the sinners at Peor. Netziv: they wanted to make vessels for the altar from the gold, so Moshe's (Moses') consent was needed.

How Rashi, Chizkuni, Sforno, and Haamek Davar explain it

Rashi And pendants (kumaz)

An ornament worn on the womb: to atone for the thoughts of the heart about the daughters of Midyan.

Chizkuni And we have brought the Eternal's offering, to make atonement for our souls

This is what we vowed before the count, when we were counted, so that no plague would rule over us. Therefore they brought it into the Tent of Meeting. And so we find: "And you shall take the atonement money and give it for the service of the Tent of Meeting" (Shemot / Exodus 30:16).

Sforno To make atonement for our souls

For the matter of Peor: that we did not stop the sinners.

Haamek Davar To make atonement for our souls before the Eternal

To make service vessels for the altar from them. This was what they asked, since these articles cause evil thoughts, and so they are like a harlot's hire, which is unfit for the altar, as stated in tractate Temurah (30b): even beaten plates made from such hire are forbidden. Therefore they needed the consent of Moshe (Moses) our teacher.

Takeaway

The atonement money, half a shekel from each person, was given at the census of the people, "so that there be no plague among them" (Shemot / Exodus 30:12–16).
In the matter of Peor many of Israel sinned with Moabite and Midyanite women, and a plague broke out (Bamidbar / Numbers 25:1–9).
The ban on bringing "a harlot's hire" to the altar is in the Torah (Devarim / Deuteronomy 23:19).