I'm so, so sorry OP. 💐You've been together a long time, so you naturally thought you knew him, but I just don't believe this is out of character.
I imagine that this sort of thing is not terribly unusual at his workplace, especially at work outings with other men, and there is a chance he's done similar before, but this time it got serious due to the SDI element.
Some men, despite being in fulfilling relationships always want extra. They're opportunists and want to add some danger and thrills into their lives . Other men just feel trapped in their comfortable lives, want to self-destruct in order to cling onto their 20s, especially if they have a baby on the way or this is on the cards. It's their desperate way of ending that because they're having serious doubts, don't want to be honest about it, or it's just not what they want.
I am reminded of someone who said 'Men generally don't leave their girlfriends. They just become progressively worse boyfriends until their female parters accept the emotional labour of ending the relationship'.
If someone did this to me, I assume he had already slotted me into the role of nice little wifey at home that provides comfort and sex, but a set-up where he clearly also wants that spice on the side and has proven himself to be the type of man that will do that and who clearly doesn't mind putting his partner at risk. It's a bad sign for the future.
OP - I feel like this is a difficult situation due to to the length of time you've been together and want to have children now.
Please think carefully about what your future might look like if you stay with him. Any relationship can break down for other reasons, but he's already shown himself to be a liability. Are you prepared to be a single mum? Are you financially independent? I don't know how STIs affect unborn babies, but do think of that. It's one thing to have children when you don't have much evidence that they'll be a faithful partner, but it's another to proceed when you've been given solid evidence of the opposite. I do think it's possible for someone to do something and never do it again, but it's a big risk to take and it could affect your relationship permanently.