In Tanzania, teenage girls who become pregnant are not allowed back in school; female MPs are forbidden from wearing fake eyelashes and nails; now, a senior government official has called on the public to report gay people so that they can be punished.

This infantilisation of women and homophobia is all part of President John Magufuli’s “morality crusade”. When he was elected in 2015, he was seen as a decisive figure determined to run a frugal government, stamp out corruption and deliver better services in the east African country.

However, in a flash, he turned from cracking down on corrupt government officials to evoking redundant colonial laws in order to police women’s bodies, reinforce discrimination against girls and now, in this latest move, to hunt down homosexuals.

Magufuli is not alone in his pursuit of a morality that rests on hatred of those who are different. Uganda passed an anti-gay law in 2013. Even though human rights organisations there successfully challenged the law and had the constitutional court annul it, hate and discrimination are still institutionalised and members of parliament have promised to retable an anti-gay bill. Female Ugandan civil servants are not allowed to wear clothes considered too short or tight-fitting and the anti-pornography act is routinely invoked against female entertainers deemed too sexy. In Tanzania and Uganda, discrimination is justified in the language of morality and the citing of questionable colonial laws. (In Tanzania, homosexuality is not illegal but sodomy is, under a law left over from British rule.)

It is an attempt to win over an impoverished populace with the message that it is better to starve than to anger God

In this #MeToo era, where the world is more alive to exclusion and abuse, you would think Tanzania and Uganda are ripe for an uprising of their own. For this discrimination is not merely a question of ageing presidents being oblivious to the realities of minorities – it keeps people at the bottom of Africa’s social pyramid in fear of their lives. It means gay and transgender people who have HIV cannot get medicine and women are unable to negotiate safe sex or demand that their partners use contraceptives (let alone decide what to wear).

In Uganda and Tanzania, where the silent consensus is that the presidents are disguised dictators, attacking “errant” women and homosexuals is an attempt to win over an impoverished populace with the message that it is better to starve and remain unemployed than to anger God. And so it is that a regime that reigns over widespread desperation but carries out “moral cleansing” does not provoke as much ire as you would think.

Such states, with discriminatory laws, also gag civil society. In Tanzania, Magufuli is the law and even the most vocal NGOs dare not challenge him lest they are closed down. In Uganda, strict laws on public assembly and NGO registration mean that they proceed with caution. At the height of Uganda’s anti-gay campaign, major donors cut the aid on which it relies to prop up health, education and security spending. Desperate, President Yoweri Museveni asked parliament to “go slow” on the anti-gay law and feigned a lack of interest when a court annulled it. While it is debatable how much the west can do, the tough stance on anti-gay laws in Uganda was proof that there are ways to hold African leaders to account. But, ultimately, it is we Africans who must stand up and demand an end to discrimination. When it comes to civil rights – the need for democratic elections, a proper judicial system and fair trial – many will speak passionately, but they will also, in the same breath, justify the need for laws to police women’s bodies and punish homosexuals. United in their moment of hate, high-sounding philosophies such as ubuntu (looking out for your neighbour) are forgotten and replaced by fiery foreign scriptures and that angry male God introduced by oppressors who stole land and humans.

The world may be tired of post-colonial guilt – the easiest thing would be to just leave Africa and its problems alone. And, with the waning interest and silence on homosexuality and other culturally contentious rights, this seems to be the route the world is taking. Besides, is the west not doing enough? From aid, to trade, to providing employment and strong-worded statements against those rights violations it considers dire?

Where, between fighting hunger and poverty, dealing with the global displacement crisis and innumerable conflicts, will there be a moment to ponder the plight of Africa’s culturally deviant? It is almost unfair to ask the world to put our hate on its agenda, but what other choice have we? The way I see it, if you leave a wild dog in my house under the pretext it is a pet, I have every right to call you to demand that you remove it, especially if I have tried every trick to get rid of it.

It is the same with the colonial-era laws on which this hate is anchored. They have been nurtured by dictatorships and the desperation of oppressed people. The “owners” of these laws have long repealed them in their own countries but, in Africa, they linger on. When we ask that the UK, Germany, France speak out against discrimination and do more to have governments repeal laws that repress gay people and women, we are only saying that it is fair that you find a way to tame the wild animal that you let loose. We do not want it to continue to eat up innocent people.

Patience Akumu is a journalist based in Uganda