I have some strong thoughts and deep feelings about this.
I don't think self pleasure is a sin. I would wonder, if a person has a partner, why one would prefer to have sex with a "ghost" rather than a live person?
I have had partners before, but I am currently unattached, and therefore, one of the things i have been working on in the pleasure department, is staying away from "fantasy". I try to experience the moment and focus on the sensations and feelings of the here and now. What harm is there in that? I don't subscribe to the notion that sex is for procreation only, and at the age of 50 I don't feel one iota of guilt at losing an opportunity to further the proliferation of the human race. There are enough young bunnies out there eager enough to do that.
If I had a partner, I would do the same thing. If the partner was someone I was committed to, I would feel guilty about thinking about having sex with someone else while I was committed to developing more and deeper intimacy with the other person. For me, it is not a matter of what the bible says, but is more based on the covenant understanding that I would have with my partner. While I value all of the great leaders in the "Spiritual Hall of Fame", I don't think that any of them said sex is bad or masterbation is bad. Oh yeah, there's that pesky prohibition in Leviticus about spilling your seed on the ground, but there is also the prohibition against eating pork and a whole lot of other "rules" in the Bible that moral law makers have bent and broken to suit their particular brand of religious rhetoric.
Still, I think that no matter what religion you subscribe to, this thing about having sex with someone in your mind while you are promised to another boils down to pure-D bonafide deceit. Can I get a "Hallelujah" brothers? I spent many many years unhappy in relationships because of the guilt that ensued as a result of my being abused. In my mind I objectified many of my "ghosts", until I began to realize that the fantasies were living ME. I didn't like that realization. As long as I was clinging to the notion that these fantasy relationships were delicious, I was powerless to begin to understand how it happened that I decided to choose the scenarios that I dredged up in my imagination.
My life has become about creating as much authenticity or honesty as I can; first with myself, and then with others. This isn't just in the sexual pleasure department. I firmly believe that the best gift that I can give to the world and to my self is the gift given with the most pure of intentions ["pure" not in the sense of sex, but in the sense that no hidden agenda is driving my vehicle].
This is such a complex issue, and I am not sure if anything that I have typed is helpful to you. All I know is that if it were not for MS, I would not even be having this monologue in reality. I value the opportunity to speak what is in my heart about this difficult subject.