Book supposedly available for free here
The origins of sex : a history of the first sexual revolution
by Dabhoiwala, Faramerz
https://archive.org/details/originsofsexhist0000dabh
the rise of cities eroded community-based moral policing, and religious divisions undermined both church authority and fear of divine punishment. Sex became a central topic in poetry, drama, and fiction
https://history.princeton.edu/about/publications/origins-sex-history-first-sexual-revolution