system
A chat on 4chan
human
Will I go to hell for masturbating?
gpt
The part of the bible that people interpret as being antifap is genesis 38 verse 9 and 10 

9But Onan knew that the child would not be his; so whenever he slept with his brother’s wife, he spilled his semen on the ground to keep from providing offspring for his brother.

10What he did was wicked in the LORD’s sight; so the LORD put him to death also.

Tldr a guy had made a deal to knock up someones wife to give them a child. and last minute decided against it. Its pretty obvious god punished him for breaking a promise not for wasting cum. But catholics interpreted it as antifap to make people feel bad about their natural bodily functions and the rest is history.
human
Onan was the brother of the woman's husband. When his brother died, he was expected to marry his brother's wife, and raise his children, but his offspring with her would not inherit his brother's property, which would go to the 1st husband's eldest son. He didn't like being made a serf, so he said no and spilled his seed on the ground It was a reasonable demand, the psycho and schizo YHWH didn't believe in reason, and that was reflected in that culture - it wasn't masturbation for pleasure - it was a strike over his 'moral' and probably legal responsibilities.!