Emily C. answered 05/14/19
B. A. in English with High Honors & Award
This is a great question, and it definitely depends on who you ask. Some will say that doctrine regarding homosexuality in Christianity emerged in relation to Old Testament teachings in Leviticus 18:22, which states "You shall not lie with a male as with a woman; it is an abomination." Likewise, scholars as early as Augustine of Hippo contended that the story of Sodom and Gomorrah (Genesis 18-19) epitomized the reasons behind anti-homosexuality ideas: "[T]hose shameful acts against nature, such as were committed in Sodom, ought everywhere and always to be detested and punished" (Confessions). The relationship between Sodom and Gomorrah and the spurning of homosexuality is why gay folks were often referred to as "Sodomites"; speculation about practices on the island of Lesbos during the 6th century--which was populated by almost exclusively women--is where we get the word "lesbian" from; and "gay" meaning same-sex relationships is in itself a divergence from the term originally meaning joyful or happy, dated as early as the 14th century but most prominently in the 17th century in relation to same-sex prostitution.
At the same as Christian doctrine was spurning homosexual practices in writing, though, practicing Christians were often homosexual or, as scholars like Eve Sedgwick have suggested, homosocial. Homosociality (and, perhaps, its most notable practitioner, William Shakespeare, whose sonnets 1-126 are understood as the "fair youth" sonnets because they were dedicated to Shakespeare's young, male lover and/or partner) is a practice whereby close relationships between same-sex partners fosters either platonic or romantic forms of love. We know, then, that homosexuality was being practiced even as expressed modes of Christianity was being preached against it.
While this helps answer the question about when anti-homosexuality appeared in Christianity, I just want to clarify that not all forms of Christianity profess or assert anti-homosexual attitudes! Christianity, like all other religions, is not a monolith (meaning that it is not just a huge group that all practices the same belief), but embraces a lot of theological diversity. A ton of groups, especially in the 21st century, have shown their support for the LGBTQIA+ community, and much scholarship on Christian sexual ethics in divinity schools across the country has fought to make space for transforming the idea that Christianity is in essence an anti-queer space. In other words, for Christian practitioners seeking an LGBTQIA+-friendly space--especially those who are themselves queer!--there are definitely communities in existence that preach inclusion.
That said, recent decisions by larger, institutional churches like the United Methodist Church to refuse to ordain ministers who identify as LGBTQIA+ shows that there remains tension within Christian communities about the relationship between religion and homosexuality.
Hopefully, this helps answer your question! If there's anything more you're interested in or need to know, please feel free to ask!