Every single society, except the modern West and it's children societies, has practiced segregation to some degree. The reason is to stop adultery.
Considering the lack of marriage, number of divorces, single mothers and infidelity in the West, and the negative broader consequences, especially of children raised by single parents (higher crime rates, greater levels of depression etc.), it is no surprise that the Muslims want to nip this problem in the bud.