After he had taken the census, David’s conscience began to bother him. And he said to the Lord, “I have sinned greatly by taking this census. Please forgive my guilt, Lord, for doing this foolish thing.”
(2 Samuel 24:10)
David’s sin was pride and ambition in counting the people so that he could glory in the size of his army, its power and its defenses. By doing this, he put his faith in the size of his army rather than in God’s power to protect them, regardless of their number. Even Joab knew a census was wrong, but David did not take his advice. We sin in a similar way when we place our security in money, possessions, or the strength of our nation.
David believed his sin caused the plague and that removing his sin would make things right. It is clear, however, that Israel rather than David was the true object of God’s wrath. God dealt with the whole nation by giving David three choices. David wisely chose the punishment that came most directly from God. He knew how brutal and harsh men could be, and he also knew God’s great mercy.
Even when you sin greatly, your greatest hope is to turn back to God (Isaiah 30:15). To be punished by God is far better than to take your chances without him.