It comes down to crowd psychology. People loot in the middle of chaos because they are in a heightened state, angry or exhilarated, and the usual restraints on behaviour loosen.
Picture the situation. You are in a dense crowd where everyone around you is doing things that would be unthinkable on an ordinary day. Cars are burning or abandoned in the road, glass is everywhere, police are overwhelmed and moving through the crowd trying to hold a line, and the shopkeepers who normally stand behind the counters have gone. In that moment, with no visible consequence and no one to stop you, the calculation people make in normal life stops applying.
It is ugly, and it is well documented, but it is a predictable response to that specific set of conditions rather than something inexplicable.