Time for a longer mulling-over of the question.
Whenever this topic comes up, the words "narcissism" and "vanity" inevitably follow. And actually, this is one of the more polite forms of the thread. Usually, there are people laughing saying "How fucking vain can you possibly be to do THAT?"
But I sort of look at it as separate and distinct from what I consider "vanity". When I think of words like "vain" and "narcissistic", I don't just picture guys who are at peace with, and happy with, who they are. Vanity seems to spring outwards from one self. Carly Simon sang "You're so vain, you probably think this song is about you" - in short, the subject of the song not only thinks he's great, but he thinks others think he's great (enough to write a song about him, anyway). The term makes me think of (say) guys who go to the gym and work out staring into the mirror, expecting others are ogling them as well.
But that doesn't apply to me. When I exercise at a gym, if I glance at myself in the mirror, I usually crack a smile. Not because I think I'm really hot, but because I think I look severely out of place.

And while I do know that other guys can and do find me attractive, I'm well-aware that I'm not everybody's cup of tea. Most guys probably would pass. And I'm cool with that.
Am I "my type"? Not necessarily. When I go look at porn, I tend not to specifically look for 40-something guys who are somewhat overweight. I CAN find that sexually alluring, but it's usually not what I'm searching for.
So if it's not (simple) vanity, or just being turned on by guys like myself, why DO I (sometimes) watch myself jerk off? I think it just comes down to something more basic, or perhaps something more complex - I like me.
I've gone to bed with guys who I know aren't objectively attractive to the world at large. But I've found them so. And I've been excited at the thought of getting off, and of getting them off. And I throw myself into the act, and enjoy myself immensely. And I honestly think that I often masturbate at that same level. I don't look at masturbation as some shameful activity. I don't consider it a weak alternative to "real" sex, or proof that I'm not attractive. It's the same way I look at staying at home on a Friday night with a good book and good music. I don't do it because "I have no friends and nobody wants to do anything with me".
I do it because I really enjoy doing it. I love reading and listening to music, and I love pleasuring myself. Even as I approach my third decade of doing it, I'm still enjoying it immensely. I still love getting off, and getting myself off (if one can separate the two parts). And no, I don't think every (or even most) gay guys would be interested in seeing me do it - that's where I think "vanity" would come into play. This activity is all about me. Which is kind of what's so enjoyable about it.
Lex