Eh, this is a bit of a half-thruth. Ancient Romans did not really categorize by sexual preference, but by gender roles taken on during sex. They basically had a penetrator-penetrated dichotomy, and taking on a "female" role was definitely shameful for men in their society, and taking on a "male" role as a woman would have been seen as a pretty big transgression, too.
This more or less continued into medieval and early modern times, until homosexuality was understood and categorized as an identity and concept. Together with a complete ignorance towards women's sexuality, this lead to punishment of lesbians being rather rare (non-penetrative sex was basically not recognised as sex), while homosexual men were punished for basically perverting gender roles of sex (also for "forcing" a "female" role on another man), instead for viewing them as having a differing identity.
While religion played a huge role to justify the discrimination of homosexuals, I'd say the root cause is the ideological imperative of maintaining sexuality as something to produce offspring, patriarchical dominance, and having women maintain their identity for sexual gratification and reproduction unless they manage to get into a monastery or similar exceptional roles (and an inherent fear of men to fall out of the male gender identity and being objectified in the same ways). That's why this is also not just an abrahamic phenomenon, but has been pretty widespread in patriarchal societies overall, although often with exceptions for "penetrating" men maintaining their status and power.