Joab tried to talk him out of it, so Joab knew it was sin. He questioned David’s motives by asking why David wanted to do it. (3) This was the promised way of escape God provided. (1 Cor. 10:13)
The census was taken, but the people did not pay the ransom required in Exodus 30:12. The ransom is required to remind the people that they are God’s, not their own and not the king’s. The penalty for failure to pay the ransom is plague.
David realized his sin and confessed. (10) He asked forgiveness. He knew he and God were separated by sin. But, he did not offer any of the sacrifices that were decreed to resolve guilt and separation.
God imposed the consequence of sin. When God imposed the consequence, he imposed the consequence he decreed in Exodus: plague broke out. God was true to his word.
With urging from God’s prophet, David finally made things right. His purchase of Araunah’s property involved payment of many shekels, a sort of restitution for the failure of the people to pay the ransom. He made a burnt offering, the most expensive offering, to show his repentance and to petition God to stop the punishment for sin. David would have laid his had on the bull to symbolize the transfer of sin, then killed the animal to make atonement for his sin. Then he offered a peace offering, symbolic of a communion meal, to be reconciled to the Lord and restored to fellowship. The Lord accepted the offerings and the plague stopped.
God is always angry about sin. Sin offends him. Atonement can be made for sin. In God’s mercy he provided a way. He foreshadowed it in the old covenant sacrifices. He brought it to fruition when he sent his son to die for us on the cross. When we receive the benefit of his sacrifice of atonement, we no longer suffer the ultimate consequence of sin. The wages of sin is death. The gift of God is eternal life. (Rom. 6:23)
Even in this disaster, God acted to further his plan of redemption. David’s purchase secured the site for the future temple, where God’s presence would dwell for many centuries and where sacrifices for sin would be made until they were fulfilled in Christ.