Not surprisingly this seems to occur most commonly where public education is underfunded or nonexistent: you end up with an undereducated electorate putting undereducated people into positions of leadership who then make underinformed decisions.
Sociological, economic, and political issues are multidimensional and must be treated as such.
TL;DR Education is important. Stop electing dumb people.