[from 2nd Samual 24]Not sure why God couldn't have chastised David more directly instead of killing 70,000 other folks.... or why his son Solomon was not punished later for a similar counting is not clear, "Solomon took a census of all foreigners in the land of Israel, like the census his father had taken, and he counted 153,600." 2nd Chronicles 2:17. He would have surely known of his father's experience...and he was, afterall, as wise as ....well... Solomon.
"David was conscience-stricken after he had counted the fighting men, and he said to the LORD, "I have sinned greatly in what I have done. Now, O LORD, I beg you, take away the guilt of your servant. I have done a very foolish thing."
11 Before David got up the next morning, the word of the LORD had come to Gad the prophet, David's seer: 12 "Go and tell David, 'This is what the LORD says: I am giving you three options. Choose one of them for me to carry out against you.' "
13 So Gad went to David and said to him, "Shall there come upon you three [b] years of famine in your land? Or three months of fleeing from your enemies while they pursue you? Or three days of plague in your land? Now then, think it over and decide how I should answer the one who sent me."
14 David said to Gad, "I am in deep distress. Let us fall into the hands of the LORD, for his mercy is great; but do not let me fall into the hands of men."
15 So the LORD sent a plague on Israel from that morning until the end of the time designated, and seventy thousand of the people from Dan to Beersheba died.
Similarly God's retribution seems not to fall on a later enumeration reported in Ezra 2:1-34 where many of the people were not only counted, but named by name...."Now these are the people of the province who came up from the captivity of the exiles, whom Nebuchadnezzar king of Babylon had taken captive to Babylon (they returned to Jerusalem and Judah, each to their own town, 2 in company with Zerubbabel, Joshua, Nehemiah, Seraiah, Reelaiah, Mordecai, Bilshan, Mispar, Bigvai, Rehum and Baanah):
The list of the men of the people of Israel: .....
So why the singular focus on David's sin became so common is unclear to me..but it lasted well into the 18th century.
In a letter from John Winthrop to Sir Nathaniel Rich he reported that the people of the Colony had not been formally numbered, by reason of " David's example," but there were believed to be more than 4000 of them.
In The "Triumph of Numbers" by I B Cohen he quotes Winthrop letter with the colorful reasonin that, "David's example sticke's somewhat with us."
From the same source I found, "In 1712, in a letter to the Lord of Trade, the Governer of New York blamed the imperfections of the census of 1712 on the fear of God's wrath and, in a report, claimed that an earlier count had been followed by excessive sickness in the colony."