In Afghanistan, part of the point seems to be to encourage some rough adeherence to local norms to reduce resentment of the US presence among locals. Hence, the ban on alcohol for US military in Afghanistan and, from TFA, in Afghanistan "commanders have forbidden any sexual encounters between unwed people." Questionable whether this is effective, but it originated as part of a bigger package of trying to discourage US forces from living in a complete bubble, separate from the political and social systems they're trying to change.
In the Iraq case described in the article, there seemed to be some concern (misguided in my view) that hooking up online, posting nudies on CL, etc., is prejudicial to the "good order and discipline in the armed forces." While agreed that the Secret Service exhibited very poor discipline in soliciting prostitutes in Colombia, I'm not sure I see how a "casual encounter" between two soldiers in Baghdad undermines good order or discipline.