When addressing any issues to do with sex in the Bible it is important to remember that sex was created by God.
The man said, “This is now bone of my bones and flesh of my flesh; she shall be called ‘woman,’ for she was taken out of man.” That is why a man leaves his father and mother and is united to his wife, and they become one flesh. Adam and his wife were both naked, and they felt no shame. Genesis 2:23-25
Adam and Eve became one flesh before sin had entered the world and they felt no shame. As with every other aspect of human life, sex has been affected by sin. Since the fall, humans have the capacity to corrupt God’s gift of sex by idolising it and using it outside the realm that God has designed it for.
Repeatedly throughout the Bible, God re-affirms that the correct place for sex is within marriage between one man and one woman.
Thou shalt not commit adultery. Exodus 20:14
“Haven’t you read,” he replied, “that at the beginning the Creator ‘made them male and female,’ and said, ‘For this reason a man will leave his father and mother and be united to his wife, and the two will become one flesh’? So they are no longer two, but one flesh. Therefore what God has joined together, let no one separate.” Matthew 19:4-6
Let marriage be held in honor among all, and let the marriage bed be undefiled, for God will judge the sexually immoral and adulterous. Hebrews 13:4
Pornography is not specifically mentioned in the Bible but involves media that is created to arouse lust, which Jesus condemns.
But I tell you that anyone who looks at a woman lustfully has already committed adultery with her in his heart. Matthew 5:28
Proverbs also contains extensive warnings against lust.
Do not lust in your heart after her beauty or let her captivate you with her eyes. Proverbs 6:25
The English word porn is derived from the Greek word porneia which is used 25 times in the New Testament, translated as sexual immorality or fornication. It includes all sexual activity outside of marriage.
But since sexual immorality is occurring, each man should have sexual relations with his own wife, and each woman with her own husband. 1 Corinthians 7:2
Masturbation is not addressed specifically in the Bible. Traditionally some Christians have referred to the story of Onan to condemn masturbation.
Then Judah said to Onan, “Sleep with your brother’s wife and fulfill your duty to her as a brother-in-law to raise up offspring for your brother.” But Onan knew that the child would not be his; so whenever he slept with his brother’s wife, he spilled his semen on the ground to keep from providing offspring for his brother. What he did was wicked in the Lord’s sight; so the Lord put him to death also. Genesis 38:8-10
On closer inspection, this story is not specifically about masturbation. God condemned Onan’s motivation to receive sexual gratification without the commitment to father a child according to the customs of the time.
Like pornography, masturbation falls under the category of porneia. It is an act that does not contribute to the union of marriage but tries to separate sexual enjoyment from marriage, which is God’s designed place for sex to occur.
It is God’s will that you should be sanctified; that you should avoid sexual immorality; that each of you should learn to control your own body in a way that is holy and honorable, not in passionate lust like the pagans, who do not know God. 1 Thessalonians 4:3-6
We are to treat men and women who are not our spouse as brothers and sisters. Porn and masturbation encourage us to view other people as objects of lust rather than children of God.