From a policy perspective, theocracies and countries with a state religion have sometimes made sex segregation laws based partially in religious traditions.
Sex segregation is sometimes pursued through policy because it is thought to produce better educational outcomes.