In 1 Corinthians 7, Paul discusses sex between a husband and wife. However, during his discourse, he says something that we might misinterpret.
I wish that all of you were as I am. But each of you has your own gift from God; one has this gift, another has that.
1 Corinthians 7:7 (NIV)
Within context, Paul has been discussing abstinence between a husband and wife for a set period.
Do not deprive each other except perhaps by mutual consent and for a time, so that you may devote yourselves to prayer. Then come together again so that Satan will not tempt you because of your lack of self-control (emphasis added)
1 Corinthians 7:5 (NIV)
Therefore, in verse seven, Paul refers to the gift of continence (self-control regarding sexual relations as revealed in verse 5). Paul isn’t advocating abstinence for everyone at all times. This brings verse one into question.
Now for the matters you wrote about: “It is good for a man not to have sexual relations with a woman.”
1 Corinthians 7:1 (NIV)
Paul’s referring to unmarried people. Indeed, he’s explicitly referring to questions the Corinthians have asked. One such question dealt with Gnosticism, which claimed that what was done in the flesh had no impact on the spirit. Therefore, some people were having sex with whomever they pleased outside the marriage bond. Hence Paul’s statement about men not having sexual relations with women (verse 1). Again, if Paul were teaching celibacy, he’d go against God’s divine command to be fruitful and multiply (Genesis 1:28).
These verses from 1 Corinthians 7 reveal the importance of interpreting and applying Scripture in context since taking them out of context produces wrong interpretations, which could lead people down life paths God never intended for them.