The reason Onan's "spilling of his seed" was wrong (in my opinion - though I know others have stated the same type thing earlier in this thread...) - in that time period - to grow the nation of Israel - a man took care of his brother's wife so his brother's family could continue. But it was the "law of the land" and "the time that it was in" made Onan's actions directly defiant to Jehovah's words. So Jehovah killed Onan. For "spilling his seed"? No. For disobeying that which he had been instructed to do - that which he knew was the wish of Jehovah "in that time period".

I cannot see how anyone could read that entire story and say that masturbation is sin.