There seem to be several issues which affect the percentage of school attendance in general and particularly attendance by gender. I will address two of the most obvious ones here.
Firstly, and perhaps most obviously, there is the matter of conflict in the area. This does not only effect overall attendance rates, but gender-specific rates as well. There are many examples of this. In Afghanistan, the net primary education attendance ratio is 66 for boys and 40 for girls. In Pakistan the corresponding figures are 62% for boys and 51% for girls. It seems natural enough, that if it not safe to go to school, parents are not willing to send their children to school.
Secondly, there is the poverty factor. In countries where poverty is a major problem, attendance rates are not as high as in richer countries. This seems to be in accordance with the idea that better education has, on the long run, a positive impact on economy. I suppose when one is very poor indeed, one does not see the big picture, as they say. Maybe it does not seem to make much sense to send children to school when their effort is needed, e.g. in the fields, for the meal of the day. If one looks at the figures for Niger, for example, one can see that only 36% of boys attend school, and only 25% of girls do the same.
In addition to these two major factors, there are other things which affect school attendance. These include culture (whether education is highly regarded and whether women are thought to be in need of education), how long comprehensive education has been around in the country (If the parents, especially the mother, have not gone to school, it might not be clear to them what benefits education can bring.) and accessibility (if there are few schools in the rural area for example)
Sources:
http://www.unicef.org/sowc08/docs/sowc08_table_5.pdf
http://news.bbc.co.uk/2/hi/country_profiles/default.stm