What an idiot. How does denying them a chance to continue with their studies after they have given birth a problem for anyone? Who is Magufuli to determine for a girl who has made a typical teen mistake how to carry on with the rest of her life after she gets pregnant? It should be a crime to stop a girl from going back to school after she has given birth. This stuff happens in Kenya in shags. It should be illegal for public schools to refuse to allow girls to go back and continue after they have had a baby.
I don't know what the situation is in Kenya these days, but unenlightened attitudes (such as Magufili's) seem to be the norm. Of course, the schoolboy or sugar daddy who had done the poking suffered no penalties and simply moved on to other "prey".
There was another curious thing I noticed at the time: students were permitted to take a break, of any length, if they had serious mental-health issues, but a break for maternal-health issues was a definite no-no. We don't need to make anything a crime; we simply have to allow for students to take a break for whatever reason they see fit.
I think the fundamental problem here has its roots in our "Christian" outlook and odd ideas of morality, e.g. if an unmarried woman becomes pregnant, it must be because she is an immoral woman, of easy virtue, ... , and a "decent" society "must not accept that; "we must punish them for their own good".