Well, for one thing, I don't think it's fair to say that he "ran against gay marriage". He never made any proposal that I'm aware of that would have made his policy law, and as you pointed out, he voted against such a policy when he had the chance.
For another thing, I don't know if there was anything really contradictory about Kerry's stance on gay marriage. There's a difference between being opposed to something personally, and wanting that something be legally banned. I don't smoke and I would advise people I know not to smoke, but I would oppose banning cigarettes. Is that inconsistent? Same thing with Kerry and gay marriage, from what I can tell.
And anyway, if you're offering this as an example of something that hurt Kerry, I'd beg to differ. His stance was identical to Bush's - no gay marriage, civil unions OK. And Bush made much more of a flip-flop than Kerry to arrive at that stance, as he earlier supported the constitutional amendment that would have banned civil unions.
I don't know if there's anything inconsistent with his stance on partial birth abortion, either. He said he wanted exceptions, and he voted against the bill when such exceptions were not included. But I'd appreciate it if you could provide citations for the positions from April 04 and Nov 03 - I wonder if they're accurately paraphrased.