The Book of Deuteronomy contains much harsher punishments for violators of the seventh commandment than those we find in the Book of Exodus. Such a tightening naturally raises questions. The simplest answer to them can be considered the deeply religious character of the book. The Book of Deuteronomy approaches the Torah, its observance, and everything connected with it from a specifically religious point of view; religion here becomes both the means of fulfilling the Torah and the criterion for observing it. It is no surprise that with such an approach formalism increases, and the rules themselves, along with the punishments for breaking them, become stricter.
This answer, however, by itself only points to the problem; it does not explain it. The explanation is connected with the idea of religiosity as a means of fighting impurity, defilement. The Book of Deuteronomy generally requires a more conscious attitude toward everything connected with observing the Torah. Meanwhile, purity, the absence of defilement as the necessary condition for the very possibility of sanctification, was the basis of everything connected with the Torah at the time when the Book of Deuteronomy was written. The main goal and chief meaning of Torah observance was precisely the preservation of purity, which we would call ritual, but which, from the point of view of a believing Yahwist of the pre-exilic era, was connected not with ritual as such, but with spiritual life as such.
For a believer, religion often becomes a means of preserving purity; it seems to him that the stricter the religious norms and rules are, and the more thorough the regulation, the closer he will come to the ideal of absolute purity, the kind that will allow him to remain sanctified constantly, always abiding in God's presence. Meanwhile, in pagan cults the sexual, erotic component always played a fairly large role, especially in the cult of the Great Goddess, so widespread in antiquity in the Near East, which often even included elements of ritual prostitution. Hence the special strictness toward everything connected with sexual life, and therefore toward the seventh commandment, which includes this aspect too, although of course it is not reducible to it in any way. It is no accident that next to the harsh prescriptions concerning adultery, laws appear in the text forbidding traditional pagan rituals connected with the cult of the Great Goddess (a ban on ritual cross-dressing, ritual plowing, and ritual sowing). Everything listed was regarded as an abuse of the power that God gives a person for life - and therefore as defilement that destroys the life not only of individual people, but of the whole community.
