If you read 2Samuel 24 (or 1Chronicles 21), you’d find that God punished David for doing a census. The reason is not explicitly written on the Bible so there are lots of interpretations on this.
One of the most popular “theories” is because David did not rely on God anymore but on his own army’s strength (hence, why he tried to find out the strength of his military power). I tend to go for the other one – because David wanted to take pride of his own army.
Reasons why David took pride of his own army in 2Samuel 24
 Look at verse 3-4 (NET)
24:3 Joab replied to the king, “May the Lord your God make the army a hundred times larger right before the eyes of my lord the king! But why does my master the king want to do this?”
24:4 But the king’s edict stood, despite the objections of Joab and the leaders of the army. So Joab and the leaders of the army left the king’s presence in order to muster the Israelite army.
“Why does my master the king want to do this?” is more accurately being written as “Why does my lord the king delight in this thing” (ESV). The word “want” comes from the word “chaphets” which can be translated as “to delight in”, “take pleasure in”.
It is clear from here that he actually takes pleasure from wanting to know how big his army is (and Joab could see/sense it). I don’t think it’s accurate if we assume the reason is because he didn’t believe in God enough (to win wars for him).
 Look at verse 9
In total, David has around 1,300,000 soldiers, ready to go to war. Now, according to these 2 sources (globalfirepower.com and statisticbrain.com), the United States has around 1,430,000 active duty soldiers by the end of 2013! See my point here? United States, ranked second in the whole world for its military power after China, has around the same army as David’s back then.
David’s army is no small army and David must have realised that. Again, it’s hard to think that David was lacking in faith about being able to win future wars. Having that kind of army would make any nation (or in this case, David, the king), swelled in pride.
And we know how God hates the arrogant so much in the bible – Lucifer, Nebuchadnezzar, King Herod, etc.
What do you think?