Alot of people get really fixated on their ex when they're going through a stressful time in their lives. It happens to both men and women. So, it's kind of natural.
Personally, I think it's kind of a coping mechanism, in that....whatever the source of your stress is, you can't quite pin it down. It's vague, but it's bugging you at the subconscious level.
It's so much easier to cast around for memories of less stressful times, and in so doing you land on pleasurable ones. Often forgetting entirely why the ex wasn't THE ONE, you become kind to obsessed with the memories of her.
I think it might be kind of like
dreaming in which the elements of your dream are, in actuality, representative of subconscious thought.

It's probably not the girl at all that you want...it's more likely the pleasurable, carefree feeling that she represents.
Anyway, I'm not a professional by any means, but by observation I have noticed that one of the key times that people tend to do this is in the early years of starting a family.
It could be that the source of your stress is actually that you're worried about how you're going to take care of your young family. ALOT of young men get really worried about that. It's a daunting amount of responsibility afterall.
Maybe you could talk to some older men, whose opinions you respect, and get some feedback. (????)