Exodus 30 · a question people ask
Why did counting people need a ransom?
The chapter gives the purpose, not a full reason: "each man shall give a ransom for his soul to the LORD when you count them, that there be no plague among them when you count them" (30:12). Counting isn't forbidden here; the LORD himself later says, "Take a census of all the congregation of the children of Israel" (Numbers 1:2). Much later, after King David counts the people, "David’s heart struck him" (2 Samuel 24:10), and "the LORD sent a pestilence on Israel" (2 Samuel 24:15). 2 Samuel doesn't mention the half shekel, and Exodus doesn't say more about why counting brought danger. What Exodus does say is that the ransom was "to make atonement for your souls" (30:15).
The verses
““When you take a census of the children of Israel, according to those who are counted among them, then each man shall give a ransom for his soul to the LORD when you count them, that there be no plague among them when you count them.”
“The rich shall not give more, and the poor shall not give less, than the half shekel, when they give the offering of the LORD, to make atonement for your souls.”
““Take a census of all the congregation of the children of Israel, by their families, by their fathers’ houses, according to the number of the names, every male, one by one,”
“David’s heart struck him after he had counted the people. David said to the LORD, “I have sinned greatly in that which I have done. But now, the LORD, put away, I beg you, the iniquity of your servant; for I have done very foolishly.””