Raisi's visit came after Uganda in May signed a law with harsh punishments for homosexuality, including the death penalty.
During his one-day visit to Uganda this week, Raisi, speaking through an interpreter, described homosexuality as an attack against the establishment of the family and inheritance — an area, he said, in which Uganda and Iran can cooperate.
"The Western countries try to identify homosexuality as an index of civilization, while this is one of the dirtiest issues," he said.
Raisi made the comments in support of Uganda’s passage of what has been described as one of the world’s harshest laws against the gay community.
The law, passed in May, imposes a death penalty for aggravated homosexuality and a 20-year prison sentence for promoting the act. The measure prompted some Ugandans to flee to neighboring Kenya.
U.S. President Joe Biden has described the measure as "wrong" and "shameful."
Human rights activist Frank Mugisha said LGBTQ human rights have been turned into a global cultural war used by countries fighting the West, which he called unfortunate.
“They keep saying that the West is pushing their own ideologies on Uganda, yet we have other countries interfering and pushing their own values on Uganda,” he said. “For example, Iran — we know they are supporting a lot of anti-gay groups here in the country, as well.”
Mugisha said that since the anti-LGBTQ law was enacted, members of the gay community have experienced multiple violations against them by landlords and local councils.
“Some of them, it’s because maybe they have appeared in the media,” he said.
“Some of them, it’s because maybe the village is trying to lynch them, and then the landlords throw them out. Some of them, because they had maybe a previous case related to their gender identity or sexuality that they need support either by counseling or making sure that the case is closed [by] police. And some of them, of course, want to leave.”
Oryem Nyeko, a Ugandan researcher at Human Rights Watch, told VOA that the posture by some politicians fanning anti-homosexuality sentiments has far reaching implications for the LGBTQ community in Africa.
"I think politicians across the board are using anti-LGBT sentiment as a tool to garner support for themselves and to bridge relationships with other like minded people," he said.
"Homosexuality is not a construct of Western countries. There are many LGBTQ Ugandans and Africans that are being impacted by this new law (the Anti-Homosexuality Law) that has been implemented essentially to discriminate against them because of their sexuality. I think it's important to talk about how this law is impacting real people, real Ugandans."
Raisi’s three-nation Africa tour was a bid to boost Iran’s diplomatic relations with the continent.
This report originates from VOA News with information from VOA’s Anita Powell. VOA's Ignatius Annor contributed.