2 Samuel 24:1-25
And again the anger of the LORD was kindled against Israel, and he moved David against them to say, Go, number Israel and Judah.…
An ordinary census was perfectly legitimate; it was expressly provided for by the Mosaic law, and upon three occasions at least a census of the people was taken by Moses without offence. It was not then the census which was displeasing to God., but the motive which inspired David to take it. Some suppose that he intended to develop the military power of the nation with a view to foreign conquest; others that he meditated the organisation of an imperial despotism and the imposition of fresh taxes. The military character of the whole proceeding, which was discussed in a council of officers and carried out under Joab's superintendence, makes it probable that it was connected with some plan for increasing the effective army, possibly with a view to foreign conquests. But whether any definite design of increased armaments or heavier taxation lay behind it or not, it seems clear that What constituted the sin of the act was the vain-glorious spirit which prompted it.
(A. F. Kirkpatrick, M. A.)
Parallel VersesKJV: And again the anger of the LORD was kindled against Israel, and he moved David against them to say, Go, number Israel and Judah.