Yes, you can get in trouble for having an affair with a married woman, even if she's not military, because it makes the military look bad when one of their own commits adultery. A great article explaining the article dealing with adultery is below:
http://usmilitary.about.com/od/justicelawlegislation/a/adultery.htm