This story sets the stage for an important event to come. David counts the people of Israel. He is depending on the number of people under his control instead of on God. God punishes David for his lack of faith by showing that He is more powerful than people. The plague of death stops, and David buys the land at the point where the plague stopped. This is the location where David’s son, Solomon, will build the Temple of the Lord.
The symbolism is amazing! God’s punishment stops at the place where Israel’s priests will soon be offering sacrifices to seek God’s forgiveness for sin. It is the ongoing story of the entire Bible: humanity’s sin and God’s forgiveness.