How in the hell does masterbation even come up as being close to a sin?

How is it a sin to please yourself? I guess it must also be a sin to color in coloring books. If you color in coloring books just for your pure enjoyment over and over is that also a sin?