Riots legitimize violence and suppression from people in power. If riots are a necessary response to violence from people in power, then people in power have the same right (and more justification) to quell riots with military or police force.
If the entity being protested was elected democratically, the entity will rely on its political sovereignty to justify police force (or violence) against protesters. Riots are unlawful because they destroy property and put people in danger. When the people are in danger, rulers are justified to quell the source of the danger—riots—with state-sanctioned police force.
Riots are never a justifiable way to petition the government for lasting social change. Only peaceful protest, resulting in civil discourse and policy amendments, will bring about lasting social change.