Were the perversions stated in Leviticus 18 so prevalent that God found it necessary to issue decrees prohibiting engaging in them? In all honesty, I was astonished to discover that incest, bestiality, child sacrifice, and homosexuality were occurring in that time period. I guess the depravity of the human mind has always been.
ב"ה Shalom When looking at the Torah, our first perspective must be one of seeing it as the eternal word of G-d given to the Jewish people from heaven. The Torah set standards of morality for all generations and since these standards were written as commandments they apply eternally. This is regardless if these perversions stated in Leviticus 18 were prevalent at the time when they were given or not. However, in your question you touched upon a very important point. Although many of the commandments say explicitly that their purpose is to distinguish the Jewish people from other nations, generally these prohibitions don't explicitly refer to a given situation. However, in Leviticus 18, The Torah explicitly refers to decadent behavior in ancient Egypt and Canaan and tells us not to do as they had done, which clearly implies that these aberrations were indeed occurring. Though, as repulsive as these thing may appear, I don't know if they should come as such a surprise at a time when there was pagan worship. All the best