So here's the thing ..... Firstly and importantly, the internet is an extremely poor place to get advice ... Most of the respondents on sites are 'lock ins' for some reason, most of them blatantly inept at relationships and frankly, not terribly well educated. Sense is of course, not common. Far from it.
The reality of your situation is clear ..... Your partner is pregnant, your relationship in trouble before that happened, but it is of course now a real mess even before 'the other woman' thing with a pregnancy which one has to suspect you do not want ... Plus of course you partner is pregnant, worried, vulnerable and carrying some of the world's most volatile hormones.
Now in truth it would not matter if you had brought this other woman home from the office and had coitus with her on top of the TV, as your wife watched ... IF
that was the deal with you and your wife. But it isn't is it ..... You knew that and know that
What you were doing was blatantly showing 'emotional intimacy' which is no different to physical intimacy in reality ... actually it is far more damaging .... Getting drunk and jumping someone bones is one thing .... But actively and regularly laughing and sharing with someone? That requires feelings of some sort,
Your wife is 100% entitled to feel totally betrayed because the 'deal' was obviously, (and all LTR are a deal), "We are best friends and other people of the same gender are not acceptable as close friends".
Myself I do not have friends of either sex and neither does my wife ... because that is who WE are ... it is what WE do .... is how WE act .... Would it suit other people? No. Do we care? No. It is us and what we do and have for 30 years+
It would seem your marriage was already in trouble before this all started, which is why it all started of course; it is a distraction, an act of pure selfishness on your part as you attempt to hide in plain sight.
There was a set of unspoken rules which you broke and frankly, in my experience of life .... You are in real trouble and if you are not divorced in 3 years time I will be genuinely surprised because she will never trust you again - not ever.
The trust is what makes it work for so many people.