Leave it to the poor to count their flocks
Lesson given: David counts the people in 2 Samuel 24. A great sin before God, serious enough for God to kill 70,000 Israelites. Question? Why would it be a sin for David to order a census?
I've read several commentaries on this age old question, of which many are plausible for example the children of Israel will be as the sands of the sea and cannot be counted, Judges Chapters 6 & 7 when Gideon was told he had too many men to go up against the Midianites, and the warning of Exodus 30:12. However, for me there are some clear reasons that fit in precisely with King David being tempted by Satan to count the Israelites that has direct connections to us Christians today.
God wants his children to stand beyond any measurement or metric for the rudiments of this world, that which is esteemed by the tradition of man which is "always" measured by size and numbers.
The World's system: The bigger the numbers the better. Strength in numbers, Polls are proven by statistics and we're programmed that numbers don't lie whereas in reality numbers are continually manipulated. We being treasures in earthen vessels are incapable of doing this and therefore must completely surrender ourselves to Jesus Christ. Read Galatians 2:20 KJV
The same goes with our bank accounts, our credit card limits the size of our home, the number of our friends, the number of followers we have on our social media accounts. Those who are continually counting their coins, followers, statistics, income and continually talking about these things are proving the depths of their carnal attachment and slavery to this world.
In Exodus 30:12 God tells Moses that in order to prevent the people from being stricken with a plague from a census, an atonement payment (a ransom for their souls) must be paid for each and every person counted. Note: God punished Israel following David's illegal census by a plague that killed 70,000 souls. 2 Samuel 24.
Since Jesus Christ paid our ransom in full, we are covered by His precious blood. However when a Christian walks outside of God's will, walking in the flesh and not in the Spirit, we are walking in condemnation. Read Romans 8:1 KJV carefully.
David certainly belonged to God and not Satan. However, when tempted by Satan to take an illegal census, David was severely punished and asked to pick his poison. God will not be mocked.
God does not want his children to be "preoccupied" with counting anything! Those who call themselves Christians who are continually preoccupied with "counting" - (the numerical result of reckoning; to esteem, consider, regard and depend upon; judge by or as the result of calculation; to establish the importance or value as the result of calculation in order to depend and rely upon) - are spiritually poor - in the same way the poor are continually preoccupied with money issues.
I invite you to study a wonderful commentary by Matthew Henry on