Until the neighbor finds out about it and kills the married bloke, then that unit is short a soldier and their are newspaper headlines that read, "Trashy Army Soldier Killed by Neighbor, for Boinking Neighbor's Wife". How's that going to look? Or, the more likelt event, the neighbor goes to post provost marshal and says that a soldier from that post is ****ing his wife, in which case, the Army wouldn't have any choice to take action. See how that works?
I'll give you a real life example: a soldier is having an affair with a female civilian. His wife finds out. She actually shows up, at the company area, during formation, with a gun, ready to shoot his ass. Fortunately, she was subdued before she could hurt anyone. But what if she would have gotten off a few rounds and hit people, other than her hubby? You're not looking at this with a wide angle lense.