1 Chronicles 27:23 indicates sufficiently why the numbering was sinful. It is also stated in 1 Chronicles 21:6, that Joab purposely omitted Levi and Benjamin from the reckoning.
Eight hundred thousand ... five hundred thousand - In Chronicles the numbers are differently given. It is probable therefore that the Chronicler has included in his statement of the sum total some numbers which are not included here.