He's normally the needy one in the relationship...
That explains a hell of a lot.
He is the one who gets his needs met by you. He needs a hug, a kiss, a word of love, sex, whatever and you give him that. You are the giver and he is the receiver.
But that changed when you needed him. Him giving that love and support to someone else simply doesnt happen in his world, he is incapable of being there for someone else. You said that you needed him more than ever and he responded by leaving, because he absolutely cannot give that support and love to someone else. He is selfish, self obsessed and emotionally immature.
He will never make a good husband and he would be the worst father. A parent, as you know, must put their own needs and wants second to their child, he would never be able to do that. You know those threads on MN where he buggers off, never sees the kids, never pays maintenance and makes out that he is the victim? That would have been your future.
As hard as it is now, and I know it is, you will look back one day and realise just what a near miss you had with this asshole.