Why did God punish the people for David’s sin of taking a census (2 Sam. 24)?
This is a difficult question, partially because we don’t have all the information needed to understand the actions of a loving, wise, and just God. In the narrative there are details that we should not overlook and that shed some light on its interpretation. I will list three of them.
1. The Sin of the People
Your question assumes that the people suffered because of David’s sin, but that’s not the case. The first verse of the narrative states, “Again the anger of the Lord was aroused against Israel” (2 Sam. 24:1).[i] It’s against this background that the story develops. The people had rebelled against God before, and they did it once more, although no specific sin is mentioned (probably their rebelling against David and supporting Absalom as king; cf. 2 Sam. 15:13). In any case, the Lord seems to have ignored the rebellion. Why? This may have something to do with the fact that there is a king in Israel through whom God works. If the problem is to be solved, the Lord must involve the king. Yet, the king and many others are innocent of the sin of the people. The solution seems to be found in demonstrating that all are sinners in order for the Lord to show justice and mercy to all. Hence, the Lord allowed Satan to entice David to sin against God by taking a military census (2 Sam. 24:1; cf. 1 Chron. 21:1). Thus, David revealed trust in and reliance on human power. The sin of David provided the occasion for God to justly punish Israel (2 Sam. 24:17).
2. Covenant Curses
What happens to David’s sin? He repents, but the Lord still asks him to choose one of three covenant curses: famine, sword (war), or plague on the land (2 Sam. 24:12, 13; cf. Deut. 28:36, 48; Lev. 26:17) as God’s reaction to the sin of the people. These three covenant curses are often mentioned together in the Old Testament (2 Sam. 24:13, 15; Jer. 14:12; 21:6, 9; Eze. 12:16). The fact that the specific punishment is based on the covenant curse shows that the people had violated the covenant law. The Lord, in His justice, sends a plague from Dan to Beersheba bringing death to the rebellious ones (He didn’t kill everybody; see 2 Sam. 24:15). The period of divine judgment ended when the Angel reached Jerusalem. The Lord preserved the people of the city—probably because they did not participate in the rebellion against David or simply out of divine mercy (2 Sam. 24:16).
3. A Larger Purpose
Embedded in the narrative is a vision of a future graciously connected to the past. The Angel of the Lord stopped, with the sword in His hand, on the place where Abraham had stood with a knife in his hand (Gen. 22:2, 9, 10). There David, like the patriarch, built an altar and offered to the Lord a burnt offering of reconciliation on behalf of the people he represented (2 Sam. 24:21, 25). On that same place in Jerusalem, Solomon later built a glorious temple for the Lord where the people would worship and seek forgiveness of sin through sacrifices that pointed to the sacrificial death of Christ (1 Kings 8:14-53; Isa. 53:5, 10-12). The narrative we just discussed is really about God’s justice and mercy.