Anderson, of the Faithful Word Baptist Church in Arizona, notoriously welcomed the gunning down in June of 50 people at a gay nightclub in Orlando, Florida by saying "there's 50 less paedophiles in this world".
South African gay and lesbian groups collected more than 60,000 signatures opposing his visit this weekend, when he was expected to preach and seek converts to his church.
Citing anti-discrimination laws designed to "prevent and prohibit hate speech", Home Affairs minister Malusi Gigaba told a media briefing he was banning Anderson indefinitely.
South Africa became the first country in Africa to legalise gay marriage in 2006, but homosexuality is still widely frowned upon and same-sex unions are often decried as "un-African".
Gigaba said that in the last 12 months, some 450,000 South Africans had attacked women who dressed and acted like men in public, and 24,000 had beaten men for dressing like women.
Anderson said he felt sorry for South Africans.
"I have been banned from South Africa and the United Kingdom," Anderson wrote on his Facebook page.
"I feel sorry for people who live in South Africa, but thank God we still have a wide open door in Botswana." It was not clear when he was due to visit Botswana.
In South Africa, gangs of men, especially in poorer black townships, have raped lesbians in the belief it will "cure" their sexual orientation.
Although the country has one of the world highest rates of rape, activists say very few cases end in conviction. Women's groups say police and the justice system have been slow to tackle the problem.