Then when he says wherefore, God gave them up he mentions the punishment for such a sin. Here it should be noted that man holds a place midway between God and the beasts and has something in common with both: with God, intellectuality; with animals, sensibility. Therefore, just as man exchanged that which was of God for what is bestial, so God subjected the divine in man, namely reason, to what is of the beast in him, his sensual desire, as it is stated: man cannot abide in his pomp (Ps 49:20), i.e., understand the likeness of the divine image in him through reason, he is like the beasts that ...perish. This, therefore, is why he says wherefore, God gave them up to the desires of their heart, so that their reason would be ruled by the desires of the heart, namely, lustful affections, about which he says below: make not provision for the flesh in its concupiscences (Rom 13:14). But this is contrary to man's natural order, in which reason dominates the sense appetites: its desire is under you and you must master it (Gen 4:7). Consequently, he releases men to the desires of the heart as to cruel masters: I will give over the Egyptians into the hand of a hard master (Isa 19:4).
It is chiefly with respect to the sense appetite that a certain bestial derangement is present in carnal sins. For the pleasures of touch, which delight gluttony and lust, are common to us and to beasts. Hence, they are more detestable, being more brutish, as the Philosopher says in Ethics III. This is designated when he says unto uncleanness, which refers to sins of the flesh, as is clear from Ephesians: every fornicator or impure man (Eph 5:5); because it is especially through such sins that man turns to and is drawn to what is beneath him. For a thing is said to be impure or tainted from being mixed with something base, as silver mixed with lead. Hence, in explanation he continues: to dishonor, by base and unclean acts, their own bodies among themselves, i.e., not as though compelled by others, for example, by savages, but they do this among themselves spontaneously. Below: has the potter no right over the clay, to make out of the same lump one vase for honor and another for dishonor? (Rom 9:21). Namely, for menial use.
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.
It should be borne in mind, however, that sin as such cannot be a punishment, because we suffer punishment against our will, whereas sin is voluntary, as Augustine says. But because sin has certain features contrary to the will of the sinner, it is by reason of them that a sin is called a punishment of a previous sin. One of these features is something preceding the sin, as the withdrawal of grace, from which it follows that a man sins. Another is something that accompanies the sin either interiorly, as that the mind is disarranged; hence Augustine says in Confessions I: you have commanded it, O Lord, and so it comes to pass that every disarranged mind is a punishment to itself; or in regard to its outward acts, which involve difficulties and labors, as sinners aver: we journeyed through trackless deserts (Wis 5:7). The third feature is something that follows the sin, such as remorse of conscience, bad reputation, and so on.
Source: Commentary on Romans