"I am sorry you feel that way, BUT I stand by what I said -- I refuse to stand here and watch my wife hurt our marriage and our children by committing infidelity - it is hurtful to this entire family."
You CAN apologize for yelling, but make it CLEAR you are NOT backing down from what your position is.
If you just say I am sorry, she will just think you are TAKING BACK the boundary.
I did this one a LOT in my home. It leaves them disarmed. On the one hand you are being sympathetic, but at the same time you are holding your dignity in tact... they often don't know how to respond to it.
Always include two points :
1. Offer her Love 2. Command her Respect
You always do 1, but you often leave out 2, and she exploits that.