In 2005, a change in military law made it illegal for anyone in the military to patronize a prostitute — even where such businesses are legal. Under those rules, someone found guilty of the offense can get a dishonorable discharge, be forced to forfeit all pay and allowances and spend up to a year in jail.
Why have any law that is not enforced or not enforceable?