You ask why he would still have got you pregnant if he wants her - you are trying to apply logic to a situation where he is able to compartmentalise, so the logic doesn't work.
You will drive yourself mad. It's Christmas Day, you're pregnant with a wanted baby and he's been such a prick for so many months / over a year now that fixating on this woman is how YOU are spending your day.
You are his wife, you are pregnant with his child, you are a mother, in his eyes you are a wholesome person, reliable, dependable and familiar.
She is his guilty pleasure, she is sexy, she is forbidden, she is fantasy yet attainable, in his eyes she is exciting and covetable.
Sounds like a case of madonna / whore syndrome to an extent. To some men, women exist to fulfil narrow roles. Yours is wife and mother. Hers is sexy and naughty. And men who think like that are so entitled that they believe they 'deserve' to have both types fawn over them, failing to stop and wonder what the fuck is so special about them that women would even want their attention.
The bottom line is, it doesn't matter why this woman is still an issue because you know the main fact - his attraction to her / preoccupation with her / feelings for her (add or delete as appropriate) are more important to him than you feeling comfortable, secure and loved.
Can you really spend the rest of your life with a man who sees you as a safe bet while he window shops and chips away at your confidence?