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 · Drash

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."

Drash דְּרָשׁ

No sin, but thoughts

One can do nothing and still feel the need to be cleansed. The midrash tells of Moshe's (Moses') talk with the officers and explains why the most hidden ornament is named among the rest.

Midrash Lekach Tov: Moshe (Moses) asked the officers whether they had sinned with the daughters of Midyan. They answered: not one of us sinned, but we did not escape thoughts. So they were all righteous. The Torah sets outer and hidden ornaments side by side to teach: whoever gazes even at a woman's little finger is as if he looked at her private place, and in the end he comes to sin.

How Midrash Lekach Tov explain it

Midrash Lekach Tov And we have brought the Eternal's offering

He said to them: "You bring an offering. What is this for? Perhaps you sinned with the daughters of Midyan?" They said to him: "Not one of us is missing": not one of us sinned. "But if we escaped the sin, we did not escape the thought". This teaches that they were all righteous. "What each man found of articles of gold". Armlets (etzadah) are bracelets on the legs, in which they step (tzoadot). Bracelet is of the arm. Ring is as it sounds. Earring is as it says: "and earrings in your ears" (Yechezkel / Ezekiel 16:12). Pendant (kumaz) is like an ornament on the womb: "here is the place of lewdness". And in the translation (Targum) it is "machoch", because it leads to levity. Scripture lists the outer ornaments together with the hidden ornaments to tell you: whoever gazes even at a woman's little finger is as if he gazed at her private place. And whoever gazes at a woman's heel is as if he gazed at her private place, and in the end he comes to sin. And everyone whose trade is with women, his way is bad, like those whom the sages listed in tractate Kiddushin, in the chapter "Ten Lineages": the bath attendant, the goldsmiths and the rest.

Takeaway

The words "if we escaped the sin, we did not escape the thought" are also brought by Rashi on this verse, from the Talmud (Shabbat 64a).
The list of trades bound up with women is in the Mishnah of tractate Kiddushin 4:14 and in the Talmud (Kiddushin 82a).