St. Thomas Aquinas treats the causality of homosexuality in his exegesis of Romans 1:24, cap. 1 l. 7:
139. But since impurity of this kind is a sin, it seems that God would not give men over to it: God himself tempts no one to evil (Jas 1:13).
The answer is that God does not give men over to impurity directly, as though inclining a man's affection toward evil, because God ordains all things to himself: the Lord has made everything for himself (Prov 16:4), whereas something is sinful through its turning from him. But he gives men over to sin indirectly, inasmuch as he justly withdraws the grace through which men are kept from sinning, just as a person would be said to cause another to fall, if he removed the ladder supporting him. In this way, one's first sin is a cause of the next, which is at the same time a punishment for the first one.
To understand this it should be noted that one sin can be the cause of another directly or indirectly: directly, inasmuch as from one sin he is inclined to another in any of three ways. In one way, when it acts as a final cause; for example, when someone from greed or envy is incited to commit murder. Second, when it acts as a material cause, as gluttony leads to lust by administering the material. Third, when it acts as a moving cause, as when many repetitions of the same sin produce a habit inclining a person to repeat the sin.
Indirectly, when the first sin merits the exclusion of grace, so that once it is removed, a man falls into another sin. In this way the first sin is the cause of the second indirectly or incidentally, inasmuch as it removes the preventative.
(translation from: Larcher, Fabian R., trans. Commentary on the Letter of Saint Paul to the Romans, ed. John Mortensen and Enrique Alarcón, with parallel Latin and the Greek text of the epistle. Lander, Wyo.: The Aquinas Institute for the Study of Sacred Doctrine, 2012. pp. 47-8)
"God does not give men over to impurity directly, as though inclining a man's affection toward evil."
In other words: He, the Author of nature, does not put same-sex attraction, which is the result of sin, in human nature.
Aquinas is saying that "one's first sin" (in this case: idolatry, turning away from God, "worshiping and serving the creature rather than the Creator") "is a cause of the next" (in this case: homosexuality, "uncleanness," "dishonoring their own bodies among themselves").