Hmm, that's a tough state to be in I assure you. Medical ethics over moral ethics can be contradicting at some points but in marriage, it should be realized that a life of one is in jeopardy if he or she is not made aware of the disease contracted by the partner.
A man who cheats and then contracts a deadly disease like HIV, is putting the wife in danger and by extension the kids as well. The doctor owes it to the wife to let her know but I would prescribe doing so anonymously if it would cost the doctor his job. An anonymous call or text message with an unknown number can be used to keep the wife abreast of the situation and help save her life.
This is my simple opinion but left for me, if I were a doctor, hmm, I would prioritize human life first than the medical ethics code.
RE: Taking a look at Ethics and it's contradictions