I’ve lived in Jordan, one of the freest and most tolerant countries in the region and I could definitely imagine that women would like to avoid atudying with men.
This was in a Gulf country. And it's not about avoiding studying with men (the majority of the population there are foreigners, and those schools attracted non-Arabs as well). Again, repeating what I saw, in the segregated school, the ratio of men to women in engineering was almost 1:1 (I don't know if that changed recently). In the university next door, it was closer to what we see in the West (way less women in engineering). However, in that same coed university, women ended up more in business majors where they were also studying alongside men. I've also seen a lot of women enter pharmacy and architecture majors.
That doesn't mean women are not interested in STEM though. I've seen a very interesting anecdote at a university in the middle east. It was segregated (men and women had different campuses), and for a certain amount of time, there were the same number, if not more, women than men in the engineering colleges. A nearby university, which was not segregated, and offered practically the same curriculum, had very few women in STEM, most women there ended up in business and media majors. Though things could probably change after graduation where female STEM graduates end up taking work that is less hands on and involves more dealing with people.