Two leaders arose (for Israel). One of them said: Let my sin not be recorded; the other: Let my sin be recorded. David said: Let my sin not be recorded, viz. (Psalms 32:1) "Of David, a maskil. Happy is he whose offense is forgiven, whose sin is covered over."
Moses said: Let my sin be recorded — whence "when you flouted My command in the desert of Tzin in the contention of the congregation." An analogy: Two women received stripes in beth-din, one for having gone astray; the other, for having eaten pagim (unripe fruits) of shevi'ith. The latter says: Please publicize my sin, so that the bystanders not say: Just as the first is being smitten for straying, so is she — whereupon they hung such a fruit on her neck and called out before her: "This one is being smitten for (having eaten) pagim."
R. Eliezer Hamodai says: Come and see how beloved are tzaddikim by the Holy One Blessed be He. For wherever their death is mentioned, there their sin is mentioned. Why all this? So that men not have an opening for saying: They died because of some (grave) secret corruption.
Similarly, in four places the death of the sons of Aaron (Nadav and Avihu) are mentioned. And wherever their death is mentioned their sin is mentioned, to stress that it was that alone which caused their death. Now does this not follow a fortiori, viz.: If the L-rd is thus merciful in a time of anger, how much more so, in a time of favor, viz. (Isaiah 49:8) "In a time of favor I have answered you, and on a day of salvation I have helped you!"