Ezra
1 Chronicles 21:6ESV·traditional attribution

But he did not include Levi and Benjamin in the numbering, for the king’s command was abhorrent to Joab.

Matthew Henry Presbyterian @wholebiblehenry

Numbering the people, one would think, was no bad thing. Why should not the shepherd know the number of his flock? But God sees not as man sees. It is plain it was wrong in David to do it, and a great provocation to God, because he did it in the pride of his heart; and there is no sin that has in it more...

Commenting on 1 Chronicles 21:1-6

Jamieson-Fausset-Brown Reformed @jfbcommentary

Levi and Benjamin counted he not--If this census was ordered with a view to the imposition of taxes, this alone would account for Levi, who were not warriors (Ch1 21:5), not being numbered (see on Num 1:47-54). The population of Benjamin had been taken (see on Ch1 7:6-11), and the register preserved in the archives of that tribe.

Adam Clarke Methodist @methodicalclarke

Levi and Benjamin counted he not - The rabbins give the following reason for this: Joab, seeing that this would bring down destruction upon the people, purposed to save two tribes. Should David ask, Why have you not numbered the Levites? Joab purposed to say, Because the Levites are not reckoned among the children of Israel. Should he ask, Why have you not numbered Benjamin?