There’s also significant input from American Evangelicals contributing to these laws. For instance, Scott Lively an evangelical anti-gay activist, helped push for Uganda to penalize same-sex relationships with the death penalty. And Islam only makes up 13.7% of Uganda.
Basically the difference between being legally supported as opposed to simply not illegal.
South Africa recognizes same sex marriages, where-as the other places allow same sex relationships legally, but don’t recognize the marriages.