The verse is part of a larger narrative detailing the Israelites' conflict with the Midianites, a group that had led Israel into sin. After the battle, the Israelites took spoils, including livestock, goods, and captives. The 32,000 women mentioned were spared because they were virgins, which was a common practice in ancient warfare to ensure lineage and purity from the victors' perspective. This practice reflects the harsh realities and cultural norms of the time, which can be difficult to reconcile with modern values.
Understanding this verse requires acknowledging the historical and cultural context of the ancient Near East, where warfare and its aftermath were brutal and often involved taking captives. While these practices are not condoned today, they provide insight into the historical setting of the Bible. This context can lead to deeper reflections on the progress humanity has made in terms of human rights and the ongoing need for compassion, justice, and mercy in our world today.