The home affairs minister said he was refused a visa as the constitution prohibits hate speech.
Mr. Anderson runs the Faithful Word Baptist Church, which says that homosexuality is an abomination punishable by the death penalty.
He said that religious freedom no longer existed in South Africa.
“I feel sorry for people who live in South Africa, but thank God we still have a wide open door in Botswana,” Mr. Anderson posted on his Facebook page after the decision to refuse him a visa.
South Africa has one of the most liberal constitutions in the world which protects gay rights.
The BBC’s Milton Nkosi in Johannesburg says, Mr. Anderson was invited by a local church to visit this month.
Two petitions with more than 60,000 signatures, organised by gay and human rights activists in South Africa, had called for the trip to be stopped.
“I have identified Steven Anderson as an undesirable person to travel to South Africa,” Home Affairs Minister Malusi Gigaba, said.
Mr. Anderson’s church is based in the US state of Arizona and describes itself as an “old-fashioned, independent, fundamental, King James Bible only, soul-winning Baptist church”.
In a video posted on YouTube before South Africa’s decision was made, he said that the trip was not going to be about homosexuality, but he stood by his views against homosexuality, which he said were endorsed by the Bible.