I'll make it pithy.
The Church bases her teachings on both the Natural Law and Divine Revelation. With the former, two of the same gender cannot procreate. With the latter, is was made clear in both the Old and New Testaments that homosexual activity is a grave sin.
The Church does her part to teach and uphold these Truths in love. Check out the Catechism of the Catholic Church for more details.