God was displeased with this thing; because this was done without any colour of necessity, and out of mere curiosity, and ostentation, and carnal confidence, as David's own conscience told him, which therefore smote him, as it is related, 2 Samuel 24:10. Therefore he smote Israel; which is particularly related in the following verses.
Related Commentaries of 1 Chronicles 21:7
1 Chronicles 21:7
7 And God was displeased with this thing; therefore he smote Israel.