From what I understand of the RCC, for you, as a Roman Catholic, yes. The Church has spoken, the matter is settled.
Selfishness/Greed - he wanted his dead brother's inheritance (a double-portion for the firstborn) and position of leadership in the family for himself, so he made sure he didn't get Tamar pregnant. If Tamar had a child, he would have received the position and inheritance instead of his uncle (and biological father) Onan.
Also, he took advantage of the pleasurable side of the Levirate marriage (see Deut 25:5-10) while refusing to abide by his obligation to Tamar in giving her children.
According to the CCC
III. THE LOVE OF HUSBAND AND WIFE
2362 "The acts in marriage by which the intimate and chaste union of the spouses takes place are noble and honorable; the truly human performance of these acts fosters the self-giving they signify and enriches the spouses in joy and gratitude."145
Sexuality is a source of joy and pleasure:
The Creator himself . . . established that in the [generative] function, spouses should experience pleasure and enjoyment of body and spirit. Therefore, the spouses do nothing evil in seeking this pleasure and enjoyment. They accept what the Creator has intended for them. At the same time, spouses should know how to keep themselves within the limits of just moderation.146
2363 The spouses' union achieves the twofold end of marriage:
the good of the spouses themselves and the transmission of life. These two meanings or values of marriage cannot be separated without altering the couple's spiritual life and compromising the goods of marriage and the future of the family. The conjugal love of man and woman thus stands under the twofold obligation of fidelity and fecundity.