Speaking as someone who A) studied to be a youth pastor in a protestant christian church, and B) wrote a research paper on the issue...
I cannot, for the life of me, find a place where scripture says masturbating is bad/sinful/useful/what ever. It says absolutely zero, zip, zilch. Which is REALLY ANNOYING to a guy who likes things to be very defined. Sigh.
What I did find was that if we are to have an ethic of/about masturbation, it must be grounded not in a law or rule, but in our relationships with others.
One thing scripture was fairly clear on is that lusting after another person is *the same* as having sex with them, and the apostle Paul was clear on Marriage First in those cases. I have heard arguments to the contrary, but I feel it's an accurate statement of Paul's (and God's) intent, plus I believe its smart for society... so that's just the premise I am going to operate under for the duration.
As I see it, there are two ways you might be able to masturbate and not violate any issue with scripture. Scratch that... three. 1) Don't lust/fantasize. 2) Lust/Fantasize of a fictional person. 3) Lust/Fantasize about your spouse.
Now, I have met a few guys who claim to have been able to masturbate without lusting/fantasizing after a person. Strikes me as boring, but... ok. I can't, so whatever.
I can create in my head a woman I want to have sex with, and it's no one real. So far as I can tell, the issue with lusting was when it was with a real person, and the effect it had on your soul... my dream has no soul, since she isn't real... so... fair game? I think so. Full discussion on this would mean more research (blah) and a lengthy talk on the nature of whom you sin against for various sins etc... yeah. Not right now.
Fantasizing about your spouse... I cannot think God would mind this. When my dad was deployed, I sure hope he thought about mom that way. One, it's a boost to her ego, and two, it helps dad go through a rough time while still binding his heart closer to mom.
That's my two cents. It's distilled from a 18 page paper I wrote about seven years ago, so if it seems vague, that's why.