This is quite interesting actually - there are probably tons of factors involved but heres one thats been touched on beforehand.
Girl's have a more concentrated iq range - i.e. there are less girls who have extremely low iqs but equally less girl geniuses. But the thing is these generally even out so the mean iqs for both genders are the same.
So now you ask well then why do gcses not reflect this.
Well maybe because GCSEs are not rigorous tests. While it is discriminating to a degree, the true upper end have capabilities WAY WAY beyond the full ums content of GCSEs. So the fact that there are more boy idiots due to the wider iq range is accounted for by the GCSE grades, but the higher proportion of boy geniuses is not accounted for because the A* grade does not allow the geniuses to distinguish themselves. The the boys' disadvantage at the lower end (more low iq people) is not able to be compensated by advantage at the upper end.
Here's a gross oversimplification to illustrate
Imagine a world where intelligence has a rating 0-10. Say an exam's content can only test capabilities up to rating 5 . The boys' true intelligence distribution might be this:
0 ,0,0,0, 10,10,10,10
and the girls :
5,5,5,5,5,5,5,5
pretty even -both have the same average
but exam test ratings would come out as following for boys:
0,0,0,0,5,5,5,5 - a mean of 2.5
and girls:
5,5,5,5,5,5,5,5 - a mean of 5
even though the true iq means for both groups is 5, the cap off at five skews the tested ratings