This article accompanies the fable
Most modern histories of masturbation take the view that while Genesis got us off to a bad start, we went right off the rails in the 18th century, when masturbation began assuming the trappings of a pathology.
First there was the exquisitely titled anonymous pamphlet of 1716: Onania; or, The Heinous Sin of Self Pollution, and all its Frightful Consequences, in both SEXES Considered, with Spiritual and Physical Advice to those who have already injured themselves by this abominable practice. And seasonable Admonition to the Youth of the nation of Both SEXES. On the web, it is attributed usually to a quack doctor John Marten, who was probably drumming up business. It made its way to the U.S. by 1724.
Rousseau appears to have been familiar with the book but his writing on masturbation is highly ambiguous. On a literal level he appears to be critical of it, especially in Emile, yet it seems from his memoirs (Confessions) that he masturbated all his life (even philosophers masturbate). This divides critics. I am with those who read his writings as ironic, in the sense that his rhetorical style is to complain about the very things he most enjoys doing, and by doing so he is able to discuss issues that otherwise would be too racy to be brought up in polite company. Try this mini-sermon on masturbation:
That is 18th century humor and it is not to be taken literally. The Encyclopédie, Voltaire, Kant and others, on the other hand, appear to have taken the criticisms of Onanism more seriously. That would be their loss, so to speak.
The most influential text on masturbation, however, was by the Swiss doctor Samuel-Auguste Tissot: Onanism: Or, a Treatise Upon the Disorders produced by Masturbation: Or, the Dangerous Effects of Secret and Excessive Venery (1760). It quickly became a bestseller all across Europe, producing guilt and shame wherever it went, for two centuries...
Everyone's favorite quotation from the book is this one, or variations on it, which describes what Dr. Tissot found one time when he visited an habitual Onanist: