Yes, for heaven's sake, it's against the rules.
Don't you remember that female pilot who was thrown out back in the 90s because of her affair with another (married) soldier? The press just ate up the spin that she was discharged "just because she fell in love". Sickening. Yes, I really want a ditz who can't control herself or her inferiors to be an officer.
There was a GENERAL that was discharged recently for an extramarital affair.
The only double standard is the one the gays are hoping to achieve.
Not being a smart ass,
but it was the General was retired. He was able to retire even with his discretion.