Genesis 38: 9-10
9And Onan knew that the seed should not be his; and it came to pass, when he went in unto his brother's wife, that he spilled it on the ground, lest that he should give seed to his brother.
10And the thing which he did displeased the LORD: wherefore he slew him also.
I think this is the masturbation reference. It doesn't apply today because
- We have carpeting now and that is just gross
- Kleenex was invented