1st Chronicles 21:1 And Satan stood up against Israel, and provoked David to number Israel. 2 And David said to Joab and to the rulers of the people, Go, number Israel from Beersheba even to Dan; and bring the number of them to me, that I may know it. 3 And Joab answered, The Lord make his people an hundred times so many more as they be: but, my lord the king, are they not all my lord's servants? why then doth my lord require this thing? why will he be a cause of trespass to Israel?
In the situation with David numbering the people, the persons who fell that fateful day were partaking of the exact same spirit which had motivated David, the only difference being that he repented quickly, whilst they did not. Thus, they became candidates for that collateral damage which was to follow, for their protection was removed by the thoughts and purposes they were harboring. This is one of the reasons why in our day, some persons who may seem to have no connection to a crime, may suffer along with the perpetrators.
[Patriarchs & Prophets pp 746] The numbering of the people would show the contrast between the weakness of the kingdom when David ascended the throne and its strength and prosperity under his rule. This would tend still further to foster the already too great self-confidence of both king and people.
The prosperity of Israel under David had been due to the blessing of God rather than to the ability of her king or the strength of her armies. But the increasing of the military resources of the kingdom would give the impression to surrounding nations that Israel's trust was in her armies, and not in the power of Jehovah.
1st Chronicles 21:4 Nevertheless the king's word prevailed against Joab. Wherefore Joab departed, and went throughout all Israel, and came to Jerusalem. 7 And God was displeased with this thing; therefore, he smote Israel. 8 And David said unto God, I have sinned greatly, because I have done this thing: but now, I beseech thee, do away the iniquity of thy servant; for I have done very foolishly.
May God add His blessing to the study of His word. “Good night” and God bless!