Without sin, Jesus' sacrifice wouldn't have been necessary and Christianity wouldn't exist at all.
The sin in masturbation comes from lust. The Bible doesn't say anything about the act of masturbation itself. However, if you imagine someone or something and masturbate, it can become adultery or possibly a form of idolatry.
It is my opinion that there is one circumstance under which masturbation is not sinful (and this is just an opinion). That is where masturbation is simply for the release of built-up tension. In this circumstance, you have not deliberately built up sexual urges, but they have come along on their own. I believe that in this instance, it is ok to get rid of that tension as long as you aren't committing adultery or idolatry in the process. In fact, I think this course of action may be preferable because otherwise those urges are likely to cause you to have adulterous thoughts.