David counts his people and 70,000 are killed for it.
Yeah, the bible has some very confusing sections and this is one. Today we read that God incites David to take a census (though in the parallel account in 2 Cor., it is Satan who, presumably under God’s direction, incites David). Back in the day, censuses (censi? censees?) were only conducted for 2 reasons: taxation and war. Only by knowing how many men you had could you know how much to tax each, or how many to call to arms. David was in a time of relative peace, so probably this was a taxation issue. I don’t buy the argument of those who claim this was about David’s pride in seeking to know just how great his kingdom was.
With Satan prompting David to this greedy taxation of his people, something Samuel had warned the people about when they pressed for a king against God’s wishes, God punishes David with a terrible choice. And David chooses to have natural causes inflict the damage rather than his enemies.
This is yet another instance of God using Satan (or “an evil spirit”) as a tool to bring His wrath or testing. From Job to Baalam to Saul to David, we see the Jewish worldview that God is in control of everything, even the bad things, even evil spirits and Satan himself. And so God punishes David for his greed, and his people suffer for it.