Judaism regards sex as being similar to eating and drinking. Eating and drinking are natural and potentially beneficial bodily functions. If done improperly, eating and drinking can become hurtful and shameful. If done properly, eating and drinking can be satiating and joyful. If done according to God's commandments (with blessings, a festive meal on Purim, four cups of wine on Passover ...), the mundane acts of eating and drinking can even be elevated to holy acts.
Likewise, Judaism sees improper sex as illicit and sinful, but proper sex as a sanctified act. Jewish Law provides guidelines for proper sexual relations.
The Torah states, "it is not good for man to be alone" (Gen. 2:18). Judaism views marriage as the essential means to companionship, intimacy and love. Just as God created the first man, Adam, and the first woman, Eve, from one body, the act of marriage returns us to oneness and completes us. Judaism values sex as a means of strengthening vitally important marital bonds.
Furthermore, the Torah states, "Be fruitful and multiply" (Genesis 1:28). This commandment elevates sex within marriage to a holy act. Couples engaging in sex for the purpose of procreation are fulfilling the word of God.
Jewish Laws, which are strictly observed only by a minority of Jews (primarily orthodox Jews), prohibits sex outside the context of marriage and restricts the times marital sex can be practiced. Jewish Law forbids both pre-marital and extra-marital sex. In addition, Jewish Law, specifically Family Purity Laws, forbids sexual relations when the wife is ritually impure (niddah). These Jewish Laws of Separation maintain that couples must abstain from sexual relations from the onset of the wife's menstrual cycle, through her five day menstrual cycle and seven post-menstrual days, and until she has purified herself by immersion in a mikvah.
In sum, Judaism, in contrast to some other religions, does not view sex as intrinsically dirty or evil. According to Judaism, sex is a mitzvah if it is done with love, within a marriage, and at the proper time.