An Exposition of Romans 1:24-27 by Dr. François Turretini (Francis Turretin)
Whether sin can be the punishment of sin. We affirm.
[...]
Proof that sin is the punishment of sin, [...] from Rom. 1:24-27 where God, as a punishment of the idolatry of the Gentiles, is said to have given them up to foul lusts and to a reprobate mind (dia touto paredōken autous ho Theos): "for this cause" (viz., on account of idolatry spoken of in v. 25) "God gave them up unto vile affections . . . receiving in themselves that recompense (antimisthian) of their error which was meet." Thus I infer: this change of the natural use of their bodies into vile lust against nature is a just recompense (antimisthia) for the idolatrous change of the glory of God into the glory of the creature and of the truth of God into a lie; this is sin and at the same time the punishment of their sin. Now this "impurity" (akatharsia) and "shamelessness" (aschēmosynē) (foul sin) is called the "recompense" (antimisthia) of the preceding wickedness. Similar to this is the other passage where God is said "to have sent them strong delusion, that they should believe a lie; that they all might be damned who believed not the truth, but had pleasure in unrighteousness" (2 Thess. 2:11, 12*). For what God inflicts upon men because they have not received the love of the truth (that not believing the truth they might be condemned) must be penal. Nor can it be said that such sins are called punishment by a metonymy of the cause because they are deserving of greater punishment (as Arminius wishes). It is one thing to deserve a new punishment; quite another to be itself punishment and the just recompense of crime (which is here said of the crimes of the Gentiles).
[...]
It is not absurd that of one and the same thing there should be contrary differences, if they are contrary and diverse relations according to which both can be predicated of it in different relations (kat' allo kai allo) (as man can be called mortal and immortal in different respects). The same action can be called both praiseworthy and just on the part of God decreeing it for punishment and so be blamed and unjust on the part of man committing it as sin. The horrible lusts of the Gentiles were just with respect God inasmuch as he gave over the nations to them as a just recompense (antimisthian) of preceding sins. Hence it is added that it "behooved them" to suffer it. Yet they were unjust with respect to the Gentiles. Hence they are said to have done "those things which are not convenient" (ta mē kathēkonta).
—Dr. François Turretini,
Institutes of Elenctic Theology, Vol. 1, pp. 653-655