The reason is, those rioters who happen to be in the Middle East were accustomed to think in a totalitarian way. The established regimes which ruled them for decades controlled their thought. Totalitarianism made them believe that the ruler is the most important person for the nation, the ruler is the nation, the people are nothing, they must serve their states because they have patriotic obligations toward their states as a type of a “blood tax”. People under repressive regimes feel like they are losers and inferior because they have no freedom of thought and without economic freedom. The only way for them to lessen their counter-pleasurable feelings is by identifying with their dictators because it is their only way of feeling achievement through the supposed achievements of their dictators, for example, in defeating other nations.
Accordingly, Middle Eastern rioters have a different perception from the individualistic way of thinking for their relationship with the world. The individualistic way of thinking mostly considers every person is responsible and held-accountable for his own actions, not for the actions of other persons. Accordingly, if people needed to be upset about something, they turn their feelings toward the person who made that thing, not against his country like in the case of totalitarianism.
Thinking of that makes it clearer to understand why those rioters take their riots very strongly against whole states and whole nations, just because someone, who happened to have a citizenship of or living in that specific state, made something which they consider as offensive.
Even worse, the rage may be motivated from a tribal perspective which is another form of a totalitarian way of thinking, making the rioters feel that they have feud against whole nations!
Please note that the totalitarian way of thinking does not only exist in the Middle East. It exists wherever there are people living under repressive regimes for a long time.