For big riots, it's clear (just watch the looting on TV) --- they don't stop it because they CAN'T stop it. Physically cannot. Too many armed people.
Another reason: several famous times in history police or equivalents have tried to stop large marches/riots (by shooting as a rule) ---- St. Petersburg in 1905, leading immediately to the Duma and to the Russian Revolution in 1917; the Champs de Mars in 1790, IIRC, leading directly to The Terror with the guillotines; Paris 1936, a pitched battle to enter and try to burn down several government buildings. In every case, revolution or the fall of the government occurred immediately afterward. In the case of Paris 1936, the government seemed to have won that night but the government fell again, never did recover, and in May 1940 the Germans swept through France to the sea and complete conquest within ten days. France fractured along the lines of the riots, and part of it was occupied by Germans for the duration of the world war and part by the pro-Nazi Vichy government. So that's another reason police don't try to stop rioting: if the rioters lose, they tend to rebel against government on a bigger scale ------------ and win. Stopping riots is fatal to politicians, often literally fatal; also to the current form of government.