I think the question of co ed versus single sex is not straightforward. There are pros and cons. Girls who feel they belong in higher level maths, science, computer science and economics lessons, who are supported to learn in a way that does not drown out their voices, can succeed, but teachers need to be mindful of it. I have heard too many teachers say - 'I know the type of student that will succeed', 'They need to be getting the answers quickly'.. 'They need to be comfortable with trying and failing'.. and when they are pushed to look at the behaviours and the scores of the girls who are quiet, who get on with their work, who understand deeply and fully before answering, who don't feel comfortable with shouting out the answers, who don't feel the need to be rewarded for the right answer.. but yet, seem to do OK in the exams... the are forced to rethink their approaches. These students often feel like they don't belong, like they are working too hard for their grades and that there are other classes where they will feel more at ease - so despite their good grades, they slink away to other subjects.
I also see classes where girls have to sit beside the boys, or be spread out around the class, meaning that not only are they removed from their female peers who they can collaborate with, they are also become responsible for the behaviour of others, often asked to show boys how to do the work, often blamed for bad behaviours, so they feel socially obligated to keep the boys quiet. There are some quiet mathematical girls who find the noise of the classroom difficult, the clicking, the swinging on the chair, the banter, the joking... these too, slink off to the girl heavy subjects.
Obviously there are boys who fit these pictures too... but it is these girls who might otherwise be in the higher maths classes, but are told or believe or feel, that they do not fit the mould.
One teacher told me that part of the reason was that girls are too good at English, so they focus on that instead. However, that was in context of an education system where it was not compulsory / desirable to take so many subjects at higher level.