Indeed, democracy is nothing more than a tool. Without proper built-in safeties, it can be used for evil just as easily as it can be used for good; that is why the constitutions of democratic countries are all longer than "Vote on stuff, majority wins." The US constitution, for example, has a built-in safety to ensure that a mere majority cannot vote away freedom of speech (changing amendments has a much higher bar).
It shouldn't surprise us when shitty things happen in democratic countries. Merely being democratic implies next to nothing about a country.