The precepts are as follows: this is the will of God, your sanctification, as if saying: All the commandments of God are for the purpose of making you holy; for sanctity means purity and constancy, and all of God's precepts lead thereto, so that a person may be cleansed from evil and constant in good: "That you may prove what is the will of God" (Rom. 12:2) which is made known through the precepts.
Then when Paul says: that you abstain, he warns them in particular; and, first, he corrects them in regard to certain inordinate practices prevalent among them; secondly, he urges them to maintain ...their virtuous actions (5:1). There were three inordinate practices prevalent among them, namely, carnal vices among a certain number of them, curiosity, and an inordinate grief for the dead. For these reasons Paul speaks about these matters. About the second inordinate practice Paul remarks in (4:9); the third inordinate practice he treats in (4:13).
In treating the first inordinate practice he does two things. First, he instructs them to refrain from the inordinate desire for carnal things; secondly, he provides a reason for this (4:6). And so he divides the first point into two. First, he forbids lust; secondly, he forbids greed. He always associates these two, for each one has reference to a corporeal object, although the latter culminates in spiritual delight.
Paul first teaches them to beware of lust in regard to a woman who is not their wife; secondly, in regard to one's own wife (4:4). Therefore Paul insists, that you abstain from immorality, for it is God's will to abstain from immorality. Therefore, it is a mortal sin, for it is contrary to the commandment and the will of God. "Beware, my son, of all immorality" (Tob. 4:12).
Source: Commentary on 1 Thessalonians