Dictators aren't immediately bad and democracies aren't immediately good.
Since most people are dumb as shit and are being herded like sheep, it requires individuals who can resist the influence of the crowd to fix problems the crowd has been conditioned to allow.
In the case of El Salvador, since whatever they were doing before wasn't working, they now need to deal with an alternative that works better.
They only have themselves and the people sucking off their gang members to blame.