I Chronicles 21:7 Midrash

וַיֵּ֙רַע֙ בְּעֵינֵ֣י הָאֱלֹהִ֔ים עַל־הַדָּבָ֖ר הַזֶּ֑ה וַיַּ֖ךְ אֶת־יִשְׂרָאֵֽל׃ (פ)

And God was displeased with this thing; therefore He smote Israel.

Read midrashic interpretation of I Chronicles 21:7: and classical rabbinic exegesis.