Looks to me like you were his back up plan the entire time. Your devotion was obvious because you were a child when you 2 first met, so he read you like a book.
You were only ever involved with him when he was inbetween women no?
He never made a serious move toward a relationship with you no?
Yet when you get married he has a lightbulb moment?
Yeah, wreaks of back up plan.
Your devotion and naivity were easy to exploit and you were available when he wanted. So your marriage caught him off guard.
If he loved you, it would not have taken him 12 years, a string of woman and a husband for him to figure it out.
Your hang up with him? Not love. How can you love someone you don't know? You love the idea of him, you love the times you did spend together and your mind filled in the blanks. When in reality he's nothing like you imagine. You're hung up because he keeps coming back, you think that means he loves you when in essence that is not a good criterion to base anything on since he never actually came back for you. He came back for what you were willing to provide. Be it solace, comfort, sex or friendship. If he came back to you for you, you'd be married to eachother ages ago. Or atleast in some sort of relationship.
Mystery of hang up solved, enigma erased, now please direct your focus to the man you promised to love and cherish.