38:7ל״ח:ז׳
1 א

רע בעיני ה'. כְּרָעָתוֹ שֶׁל אוֹנָן, מַשְׁחִית זַרְעוֹ, שֶׁנֶּאֱמַר בְּאוֹנָן וַיָּמֶת גַּם אֹתוֹ, כְּמִיתָתוֹ שֶׁל עֵר מִיתָתוֹ שֶׁל אוֹנָן. וְלָמָּה הָיָה עֵר מַשְׁחִית זַרְעוֹ? כְּדֵי שֶׁלֹּא תִּתְעַבֵּר וְיַכְחִישׁ יָפְיָהּ:

רע בעיני ה' WAS WICKED IN THE EYES OF THE LORD — like the wickedness of Onan, and committing the same sin. This must have been the case because of Onan it is said, (v. 10) “And the Lord slew him also — Onan’s death was for a similar reason as Er’s death. Why did Er commit this sin? So that she should not bear children and her beauty thereby become impaired (Yevamot 34b).