Well first things first, there are countries in Africa that support it, or at least it's not completely outlawed. Countries like South Africa actually has laws that protect LGBT(Lesbian Gay Bisexual Transgender) rights, and there are countries that may not openly support it, but they don't oppose it as well.
Although there are countries that support it, homosexuality still faces strong opposition in Africa, it's essentially seen as something that's not "African" and was brought to the continent by other countries. The thing is that there are actually lots of instances where African history has been shown to indicate the presence of homosexuality. King Mwanga II of the Buganda kingdom which is now Uganda was said to be gay but nobody ever criticised or had any issues with him.
Whether or not they didn't say anything about his sexuality because he was king was what I'm not entirely sure about, but it proves that homosexuality was indeed here in Africa long before the interference of outside countries. There are also instances in Yoruba and Hausa culture which prove that homosexuality has actually been in existence in Africa but the question is why all of a sudden people are against it.
I believe that the answer stems from the imported religions of Christianity and Islam that was forced upon Africans by our colonisers. I'm not sure about Islam, but I know that homosexuality is a sin in Christianity and as such it's no wonder that Africans are against it so much. We're literally the most religious of the 7 continents and as such, the thought of legalising a sin is unimaginable.
We say it's not our culture but it is, at least in some parts of the continent, artworks have even been found that depict homosexual activity but yet it's still frowned upon in Africa. To answer your question, there are two main reasons why Africans are against homosexuality and they are
1. We believe it's not our culture
2.The beliefs and laws of our adopted religions do not accept it.
I hope this helps.
Africans are people who hold our culture very close our hearts.as an African there are certain ethics that guide us,defines us and makes us who we are. If we loose those ethics, we loose who we are.
Based on homosexuality, it is seen as a sacrilege by Africans. Africans believe that a man should be married to his wife or wives and not to another man. Neither a woman married to another woman.
Homosexuality is a norm that all African countries forbid because it's part of our culture.
Although countries like South Africa and Mozambique have legalized it, there's no protection for gay people in those areas so they are prone to discrimination and persecution.
African culture doesn't believe in homosexuality. It is taboo amongst their society. It isn't a written law but is just embedded in their culture.
In Africa most of the society believe in families and the more children you have the wealthier you are. It is seen as the devil has changed you and that you are not the same. Gays are shunned by society and can lead to death in some countries not legally but it happens.