All those countries have 3 things in common: they're poor, backward and religious.
The poorer a country gets the more backward it becomes, the more religion will thrive. There's a reason the Bachmanns and Perrys are running in 2012 and not in 2002.
Be fucking vigilant. People capable of these kinda acts are amongst us, and they'll use their cover of some kind of ideology to defend their actions until it has lost the taboo status in society.
See this movie, "Die Welle", in which a teacher tries to recreate the circumstances on which the Nazis came to power in his classroom, by moving things from the taboo zone (brutalizing people) to accepted by society through peer pressure.
In all these shithole countries there is a culture of non-intervention or joining in when gay people get singled out, punished, killed, etc. under some vague cloak of religion. Our innate human sense that persecution is wrong is silenced by the pressure to conform.
By the looks of it, the first thing a society needs to do is move from collectivism to individualism - what happened in the West during the 60s and 70s - where it becomes acceptable for individuals to stand up for what they think is right. Otherwise everybody stays silent forever, and you end up with countries like the islamic ones.