It would be great if we somehow found a way to ensure that everyone had every need fulfilled. However, that is orthogonal to the issue of what to do when a person has crossed the line we've drawn in the sand for what is acceptable in a safe society.
Some people simply decide they'd rather keep their money and the product. After you remove "law and order" that actually becomes the most rational individual decision.
I have no doubt that the phenomenon you mention certainly exists. I do, however question whether its prevalence is enough to be noticeable on an income statement.
There seems to be something else at work in San Francisco, and the question is how we should contextualize it morally (which will influence our preferred policy approach as voters). Is it people stealing because they are desperate for the necessities that one would encounter at a drugstore (something we should feel sorry about). Or, are they organized crime rings making a quick buck at someone else's expense due to loopholes in the legal system (something we should be pissed off about).
I alternate between the two perspectives based on my own experiences viewing urban poverty up-close, the discussions shared in the HN Walgreens threads, as well as some of the videos shared of organized groups of people clearly looting high-value items. It's something I don't really have a solidly-formed opinion on, and there seems to be an abundance of nuance.