Cheating on your spouse can get you kicked out of the military altogether, among other possible punishments.
While not a unique law to the military — 21 states have anti-adultery laws on the books that are rarely enforced — commanders do sometimes charge service members with this crime.
Still, adultery charges are a bit hard to stick, since they can be difficult to prove.
Maximum punishment: Dishonorable discharge, forfeiture of all pay and allowances, and confinement for 1 year.