Masturbation is frowned on in every religion I'm aware of.
In the ones I'm most familiar with, Buddhism & Hinduism, it's viewed as a senseless (or sense-engrossed) waste of essential energy. The semen is held to be a spiritually charged fluid containing the physical essence of pure consciousness; the vital essence.
It's an incredibly information-dense substance [fact], and [conjecture supported by evidence] its chemicals when processed by the body give rise to nourishment for the brain, and the neurotransmitters associated with mystical experience - say, DMT.
It's not so much it's a sin in that you're hurting someone, it's a 'sin' that you're limiting yourself to lower states of mind. Sin in the sense that a less-than-optimal condition is arrived at. It's its own punishment, so to speak. In this sense, every form of mundane fixation is a sin, a karmic fetter.
In other news...
Masturbation feeds a false addiction. It can also result in distorted sexual relationships with others, and create inclinations, fantasies and shape orientations in such a way as to make actual sexual relationships with others less-than-satisfying, and incomplete as compared to the tastes one has developed, especially when paired with pornography.