Upvote:5
Short answer: Gonorrhea and syphilis, neither of which was curable until around WWII (with the advent of penicillin). There were other lesser-known incurable (at the time) STDs as well. Your conjecture that associating with loose women could perhaps affect your marriage and cause stress is undoubtedly also true for married men (imagine bringing syphilis home to your wife, which did indeed happen).
Incidentally, there are now drug-resistant forms of gonorrhea and of syphilis today, plus the added "attractions" of herpes, genital warts, and HIV, so the advice applies even more so today than it did in the past.