Genesis chapter 19 says "And there came two angels to Sodom..." followed by a lot of words that can, and has been, misinterpreted throughout the years.
Now you can read it yourself, but here's the gist: God sends male angels to towns Sodom and Gomorrah to check if their citizens are really as wicked as rumored to be. Turns out they are -- so much so that male Sodomites barged in the home where the angels are staying, and try to rape them.
Thus the word "sodomy" was born and has been endlessly used to define any homosexual acts to be sinful which many bible scholars disagree with. They argue that the story of Sodom and Gomorrah alludes to sins like, abusing strangers and being inhospitable.
Read more about what the Pope could do for gay Africans:
Patheos: Why Did God Destroy Sodom and Gomorrah?
Huffington Post: Who Are the Real Sodomites?