Let's clear up one misconception. God is pro-sex! He invented sex and thinks it's beautiful when enjoyed within the correct framework.
Proverbs tells us, "Take pleasure in the wife of your youth ... let her breasts always satisfy you; be lost in her love forever" (Pr 5:18-19). The context here is speaking of sex within the parameters of a lifelong marriage commitment (i.e., "the wife of your youth"). Another example of God's perspective on sex is the Song of Songs, an OT book that uses the beauty of the sexual experience to express one's spiritual experience.
I haven't been able to locate a single verse in the Bible that decries sex as sinful, dirty, or wrong. It's only the misuse of sex (when it is experienced outside a loving, intimate commitment between a husband and wife) that is so often spoken against in the Scriptures. Sex as God intended it is a beautiful thing.
So, why the limits? Simply put, it's because God loves us. Love is described in Eph 5:28-29 as providing and caring, which suggests the ideas of nurturing and protecting. God's motivation behind every command in the Bible is to protect us and provide us with His best. Even in the "do nots" (commandments that may, at first glance, seem imposing and prohibitive), we can know that God has our best interests at heart. How can we be sure of His loving intentions? We need only look at the life of Christ as recorded in the Gospels. Everything He did-from healing the sick and teaching the multitudes to giving His life on the cross to pay for our sins-was a clear picture of God's love in action.
True to His loving nature, God gave His instruction to reserve sex for marriage out of love for us. In this case His boundaries protect us from unwanted pregnancies, agonizing and even deadly diseases, unhealthy emotional attachments, feelings of guilt, and many other dangers. They provide us with good health and safety, freedom from fear, true intimacy and trust in marriage, and many other benefits.
Just as the lanes in a swimming pool protect swimmers from running into one another and give them every opportunity to win a swimming race, so God's laws are intended for our good. They are not there to frustrate us but to reflect the freedom we have in Christ. Without the parameters, one cannot experience sex in the way God intended. And when we recognize His loving plan for us-a positive plan for our good and not a negative plan to limit us unfairly or frustrate us-our response should be one of loving obedience.
Extracted from the Apologetics Study Bible.