text: The dawn of creation was a long time ago. 
  
  There are, unsurprisingly, people who are actually trying to puzzle out how true the narrative you offer is. At present, there's enough scholarship on the table to show that "virtually every society" is overstating the case a bit. There are historical documents in which missionaries discuss the unabashed sexual depravities within local communities, and decry the general toleration of such behaviors. The correction of sexual depravity was a vital aspect of their evangelization. And as colonies took shape, the Europeans administering them brought the violent force of civil law to bear on the problem. I'm not saying that was the situation everywhere, but it did play out that way many times. Homosexuals probably were also anathematized, but the universality you speak of appears to be of relatively recent Christian and Islamic manufacture.