In Chronicles, David took a census on the people of Israel. However, God became angry at this, and he proceeded to destroy about 70,000 people in result.
1 Chronicles 21:1-16: 1Satan rose up against Israel and caused David to take a census of the people of Israel. 2So David said to Joab and the commanders of the army, “Take a census of all the people of Israel—from Beersheba in the south to Dan in the north—and bring me a report so I may know how many there are.” 3But Joab replied, “May the Lord increase the number of his people a hundred times over! But why, my lord the king, do you want to do this? Are they not all your servants? Why must you cause Israel to sin?”
4But the king insisted that they take the census, so Joab traveled throughout all Israel to count the people. Then he returned to Jerusalem 5and reported the number of people to David. There were 1,100,000 warriors in all Israel who could handle a sword, and 470,000 in Judah. 6But Joab did not include the tribes of Levi and Benjamin in the census because he was so distressed at what the king had made him do.
Judgment for David’s Sin
7 God was very displeased with the census, and he punished Israel for it. 8Then David said to God, “I have sinned greatly by taking this census. Please forgive my guilt for doing this foolish thing.” 9Then the Lord spoke to Gad, David’s seer. This was the message: 10“Go and say to David, ‘This is what the Lord says: I will give you three choices. Choose one of these punishments, and I will inflict it on you.’”
11So Gad came to David and said, “These are the choices the Lord has given you. 12You may choose three years of famine, three months of destruction by the sword of your enemies, or three days of severe plague as the angel of the Lord brings devastation throughout the land of Israel. Decide what answer I should give the Lord who sent me.”
13“I’m in a desperate situation!” David replied to Gad. “But let me fall into the hands of the Lord, for his mercy is very great. Do not let me fall into human hands.”
14So the Lord sent a plague upon Israel, and 70,000 people died as a result. 15And God sent an angel to destroy Jerusalem. But just as the angel was preparing to destroy it, the Lord relented and said to the death angel, “Stop! That is enough!” At that moment the angel of the Lord was standing by the threshing floor of Araunah the Jebusite.
16David looked up and saw the angel of the Lord standing between heaven and earth with his sword drawn, reaching out over Jerusalem. So David and the leaders of Israel put on burlap to show their deep distress and fell face down on the ground.
But this passage does not state the reason for God doing this. What was so wrong about taking census of people of Israel?