Have you even read or the quran or any hadith? I have, and there is ample stuff there for people to take as violence being justifiable and even promoted. Remember Muhammad was a warlord.
So we have to remember, religions can easily be used to promote violence. It is appalling but it is a fact of life.
Now going back to Islam knowing that religion can be used as a tool for violence, then throw in a healthy dose of mob mentality in which the individual ceases to think rationally and independently, bad things can happen. Not all 20,000 people may have wanted to become violent, but some did.