Your sexual organs need exercise to be healthy, just like every other part of your body. Ethics is more rational when we replace the Good vs Evil dichotomy with Healthy vs Unhealthy.
There is no medical need for people to masturbate unless they have some form of sexual dysfunction which can be treated by it, it looks to be neutral in moderation.
Masturbation is not necessary for the functioning of the body or the sexual organs of men in general, it is an optional personal choice they can make to do, not medical necessity.