Do you seriously believe that out-of-wedlock sex the only immoral action someone can commit?
Stoning a woman to death for sex outside of marriage is immoral. Gunning her down over “family honor,” still done in many parts of the world, is immoral. Judging and stigmatizing her for life over so much as one out-of-wedlock sexual encounter is immoral. Shipping her off for a quiet adoption - or worse yet, abortion - to avoid family “shame” is immoral. Denying her the rights and opportunities available to men just because she gets pregnant is immoral.
It sounds like societies have had no problem openly accepting immorality.