As Rabbi Joseph Telushkin explains in "Jewish Wisdom," "...the Talmud never associated saintliness with a dormant libido." He explains that the great rabbis often struggled with their sexual passions. The Talmud even states, "The greater a man, the greater his evil inclination (Babylonian Talmud, Sukkah 52a)."
The rabbis understood that women have a sexual drive as well as men. Telushkin quotes from the Mishna, "If a man forbids himself by vow from having intercourse with his wife, the School of Shammai says [she must go along with the vow] for up to two weeks [if it lasts longer, the court can compel him to divorce her], but the school of Hillel says for [only] one week."
Judaism also teaches that lust that results in male masturbation is wrong, as men are not supposed to spill their seed in vain.