Uganda's pretty well developed, so it is a little surprising that they'd pull this off, yes. However, when you consider how very religious they are, it's actually a little bit expected. Really, the only reason other heavily religious places don't do this is because of the bad publicity it would bring. It's a little impressive that they're getting away with it.
Frankly, you'd have to be kind of dumb to be a gay living in Uganda anyway; Prejudice and abuse against gays and many other minorities has always been very prevalent in the country, so this would be all the more reason to get out now.