Thank you for bringing up this verse, because when we look at things with modern eyes, they do not seem to be an issue at all. But like you point to context is key. When looking at 2 Samuel 24 or 1 Chronicles 21, which retells the story, we get some of the context. The commentaries point that it was a source of pride (https://biblehub.com/2_samuel/24-1.htm) that led to the counting. But I also seem to recall what a professor of mine once pointed out, although that was nearly twenty years ago, so it might have been someone else. This David, who had stood up to armies as a youth, with only the Lord with him, is now finding his source of pride in strength in how many men are in his army. It was not the army that defeated Goliath, but one youth with five stones (1 Sam 17). “‘For My thoughts are not your thoughts,
Nor are your ways My ways,’ declares the Lord” (Isaiah 55:8, NASB).Originally David built his kingdom on faith in the Lord, totally unlike how every other kingdom had been made, before or since, and he was degrading it by looking at his kingdom the same way as everyone else.
At least that is how it had been explained to me. Have you come across anything else?
@Tepichin I agree with @bjbrandt’s summary. You may also find the following thread helpful in thinking through this passage. Christ grant you understanding
Why was the census wrong?
The most clear explanation is that David had grown proud and believed he would win by military might. He had taken his eyes off of God and instead begun to have pride in his military assets. This makes even more sense when we consider the punishments he could choose from included having to flee before his enemies - a punishment he specifically rejects in favor of placing himself in the hands of God.
In fact, perhaps God chose these 3 punishments specifically to give David a chance to choose God’s mercy over the mercy of men and to remember that God’s mercy and goodness established him in the first place. David takes the cue - and does not place himself in the hands of men - who cannot save him and who have not the kindness and mercy of God.
Deuteronomy 20:1-4 -When you go to war against your enemies and see horses and chariots and an army greater than yours, do not be afraid of them, because the Lord your God, who brought you up out of Egypt, will be with you. 2 When you are about to go into battle, the priest shall come forward and address the army. 3 He shall say: “Hear, Israel: Today you are going into battle against your enemies. Do not be fainthearted or afraid; do not panic or be terrified by them. 4 For the Lord your God is the one who goes with you to fight for you against your enemies to give you victory.”
One possible explanation from Exodus is that David forgot to take a tax, but as the commentary mentions this is unlikely given the context. The author makes no mention of this passage.
Exodus 30:12 - When you take a census of the Israelites to count them, each one must pay the Lord a ransom for his life at the time he is counted. Then no plague will come on them when you number them.
“At least two major factors complicate the reader’s understanding of this incident. The first is the lack of any explanation of the nature of David’s sin. Taking a census was not new and neither was it inherently wrong (cf. Num 1:2-3, 45-46; 26:2-4). However, these texts clearly indicate that David’s action was sinful. The following are possible reasons: (1) David failed to collect the monetary offering required of each person counted (Exod 30:11-16). To do so would seem to be direct disobedience. However, the writer in Numbers mentions no offering in connection with a census, and the implication is that none was taken. (2) David was acting in simple pride. He wanted to gloat about the great numbers he had at his disposal. However JOAB’s response seems to indicate a more serious problem. (3) David was depending more upon himself than upon the Lord for direction and protection. For example, the census could have been a first step in organizing a military draft. It certainly had a military flavor. Such an act would, in turn, imply that David had personal ambitions to expand his kingdom and a tendency to feel falsely secure because of his great numbers of potential soldiers. The punishment that followed seems to confirm the legitimacy of this last explanation. Since David was tempted to overstep his bounds because of a potential great army, its ranks were diminished significantly (cf. Gideon’s experience in Judg 7).” Watson E. Mills