Well when it comes to being viewed as unnatural, lots of writings from around the 12th century can point to hostilities beginning. Homosexuality was punishible by prison time or even death. It really started changing in the early 19th century, when many people became more interested in using science and psychology for answers. Homosexuality was generally believed to be a disease, so this led people to the idea that it could be cured. People like Sigmund Freud helped to advocate for the idea that it was a "curable disease" or even something that cannot and should not be cured, as evidenced in his "Letter to an American Mother." Of course, this is a very basic explanation because it's largely Western and doesn't elaborate on cabaret scenes or anything like that. J. Katz's book is very good. Anything by Leslie Feinberg is absolutely amazing to read if you want firsthand stories. The Lavender Scare by David K. Johnson, or Long Road to Freedom by Mark Thompson and Randy Shilts all make for interesting reading.
Katz, J (1995). Gay and American History: Lesbians and Gay Men in the United States. New York: Thomas Crowell.
Freud, Sigmund (1951). "Letter to an American Mother". American Journal of Psychiatry. 107: 787. doi:10.1176/ajp.107.10.786.