The basic idea behind the passage is that David was asserting ownership of the people of Israel rather than recognizing that they belong to God.
In Jewish tradition census taking of the people of Israel was forbidden (Hosea 2:1). Moses was only permitted to take a census indirectly (Exodus 30:12-13) by having each Israelite offer a coin as a sin offering and then count the coins. By only being able to count what the people offered to God it reinforced the point that the people do not belong to Moses or any leader.
Jewish commentaries also stress that a census divides and separates the Jewish people into categories and individuals rather than treat them as a unified people of God. Judaism teaches that each individual person is of infinite value to the body of Israel and should never be reduced to a category or number.
David had no reason for taking his census other than his own curiosity and personal future plans. He treated the people of Israel as if they belonged to him and were his to do with as he pleased. God punished him for his pride and reminded him that everything belongs to God.
DISCLAIMER: Catholic Answers has turned over the archive to Catholic-Questions.org and no longer owns, manages, or moderates the forums. For additional apologetics resources please visit www.catholic.com.