ספר המדות, Punishment Punishment · א
Sefer HaMiddot 1826
א. לִפְעָמִים כְּשֶׁאָדָם עוֹשֶׂה מִצְוָה, וְהַקָּדוֹשׁ בָּרוּךְ הוּא מַעֲנִישׁ אוֹתוֹ, זֶה מֵחֲמַת שֶׁלֹּא עָשָׂה מִצְוָה כָּזֶה, כְּשֶׁבָּאָה לְיָדוֹ.
1. Sometimes, when a person performs a mitzva (Divine commandment/good deed) and the Holy One, Blessed be He, punishes him, this is because he did not perform a similar Divine commandment when he had the opportunity to do so.