There's a limited resource: gasoline. There's a supply shock: a hurricane has shut down refineries. There's now less of the resource to go around. Gas will have to be rationed somehow. As a policymaker, you must respond to the crisis. What do you do? Make the most efficient rationing mechanism illegal, of course:
South Carolina Attorney General Henry McMaster is invoking a state law that allows criminal penalties against gas stations that set their prices too high.
As any Econ 101 textbook would predict, this policy and others like it are resulting in gasoline shortages all over the Southeast. This is great for those who were lucky enough to get the cheap gas, but not so great for everyone else.
In the world of scarce resources in which we live, rationing is always necessary. The wonder of prices is that because they ration so well without any central direction we don't have to understand or even think about them for the process to work. A problem comes, however, when the results of this rationing jump into the fore of our conscious because they seem to conflict with the moral intuition that it is wrong to profit from distress.
This intuition may have good properties, but one thing it is not good for is ensuring that there's enough of a resource to go around; indeed, anti-gouging legislation, the codification of this intuition, actually reduces the quantity of a resource available during crises by eliminating the incentive effects that high prices have for increasing supply (especially in the long run). Examining the outcomes of both scenarios, therefore, renders the moral superiority of anti-gouging sentiment to be dubious.
As a consumer, not wanting to feel gouged is just as valid as a preference for a high price over no gasoline at all, and firms respond to these preferences in various ways. Legislation needn't make criminal the response of a firm to the latter preference any more than legislation should make it criminal for clothing stores to sell white after Labor Day.