There have been five major developments in the history of Christian reflection on sex, and we are in the midst of one that represents a significant response to modernity.
1) Waiting for the end times. The first development came from St. Paul in response to the sexual mores of the Roman world. His early letters show a breathless anticipation of the return of Jesus, and so his urgent message was "be ready!" Following Jesus' counsel that in the resurrection, people do not marry (Mk. 12:25; Lk. 20:35), Paul suggests that it is best not to marry in order to be ready (1 Cor. 7), but he also realizes that it is better to marry than to fall into lust.
2) Legislating marriage. As the earliest anticipation of the return of Jesus changed with the passing of each generation, Christians followed patterns of marriage common in the Roman empire, eventually bringing them to local bishops for blessings. At the same time, though, certain strains of Greek thought (especially Neoplatonic and Stoic), as well as various syncretistic strains of Gnosticism and Manicheism, were looking at the flesh as ugly and the soul alone worth cultivating.
There developed different extreme attitudes toward sex: some holding that since only the soul mattered, any sort of sex (for example, ritual prostitution) was fine; others eschewed sex altogether. Certain strains of the latter view influenced Christian thinking (as in figures such as Origen and Jerome). Saint Augustine eventually developed a moderate position, suggesting that marriage is good. For him, sex itself, rooted in desires that have been disordered as a result of the Fall, was tainted with venial sin, yet could still be ordered toward the larger good of procreation in the context of Christian marriage. Later canonists such as Gratian (12th c.) followed Augustine's basic observation, creating legislation around the establishment and function of marriage in the Church. Such legislation was rooted in part in the pastoral demand to protect women and children from the predations of unscrupulous men.
3) Sacralizing sex. The 12th-century writer Bernard of Clairvaux wrote almost ninety sermons on the Song of Songs, the erotic love poem of the Old Testament, as a metaphor for God's love of the human soul. Similarly, Aelred of Rievaulx wrote a canny and influential treatise on spiritual friendship. Later authors such as John of the Cross and Teresa of Avila (16th c.) would use erotic imagery to describe the soul's union with God.
4) Personalizing marriage. In the 20th century, with the rise of modernism and changing sexual mores, Catholic theologians such as Dietrich von Hildebrand and Herbert Doms began to reflect on the limitations of the juridical focus of much writing on marriage in the Church. The Protestant theologian Karl Barth once famously remarked that Catholics had a theology of the wedding, but not of marriage. What had been held as the "primary" end of marriage for centuries—the procreation and education of children—slowly became perceived as one of two "goods" of marriage, the other being the union of husband and wife.
It was the encyclical Casti Connubii by Pius XI (1930) that made explicit this focus on the personal good of marriage for spouses. Later, the writing of John Paul II, especially his catecheses on the book of Genesis, which form the now popularly known Theology of the Body, explored in great detail the potential of sexuality to draw man and woman into loving communion with each other with the common goals of mutual support and cooperation in family-building. The older view of marriage in canon law had focused on the job spouses did in building the kingdom of God; this new, personalist view focused on how sex also invited people to greater love and freedom.
5) Organic sex. The most recent development shares something with the preceding ones: it builds upon the most prominent philosophical currents of the time. Marriage legislation was built on a theory of Natural Law; sacralizing sex was caught up in the same views of eros that fueled the medieval romances and troubadours; personalizing sex was rooted in the same lens on human experiencing that fascinated phenomenologist and existentialist philosophers and modernist writers. Today's fascination with sustainable, chemical-free, non-corporation-mediated sex fits the zeitgeist of this postmodern age.