Read Slate’s complete coverage of Hurricane Sandy.

Even in these polarized times, there are some things politicians of both parties can agree. Price gouging, for example, is wrong. New York Attorney General Eric Scheiderman, a Democrat, wants you to know it. But this isn’t just for soft-hearted liberals. New Jersey’s notoriously tough conservative governor, Chris Christie, also put out a weekend press release warning that “price gouging during a state of emergency is illegal” and that complaints would be investigated by the attorney general. Specifically, Garden State merchants are barred from raising prices more than 10 percent over their normal level during emergency conditions (New York’s anti-gouging law sets a less precise definition, barring “unconscionably extreme” increases).

The bipartisan indignation is heartening, but there’s one problem. These laws are hideously misguided. Stopping price hikes during disasters may sound like a way to help people, but all it does is exacerbate shortages and complicate preparedness.

The basic imperative to allocate goods efficiently doesn’t vanish in a storm or other crisis. If anything, it becomes more important. And price controls in an emergency have the same results as they do any other time: They lead to shortages and overconsumption. Letting merchants raise prices if they think customers will be willing to pay more isn’t a concession to greed. Rather, it creates much-needed incentives for people to think harder about what they really need and appropriately rewards vendors who manage their inventories well.

Consider the case of poor Thakur Gas of Branchville, N.J., which was hit with a $50,000 fine in late September for price gouging charges arising out of Tropical Storm Irene. Christie specifically cited the case over the weekend as a cautionary tale of what awaits New Jersey retailers who try to adjust prices to shifting supply and demand conditions. Thakur’s crime, according to court papers, was raising the prices 17 percent when the storm hit, causing the store’s gross margins to spike.

This seems like a straightforward violation of New Jersey law, but what Thakur did also make perfect business sense. If there’s elevated demand for your product, you try to sell more of it. But if you can’t sell more volume because supplies have been disrupted by a storm, you raise prices. Customers aren’t going to like it (and the need to maintain good will with your customers should be a factor in any business’s decision-making) but they’re also not going to like it if you run out of gasoline by 2 p.m. because it has all been bought up by earlier, stockpiling drivers.

What Branchville, N.J., drivers ought to fear isn’t a few days of high gasoline prices, it’s the risk that station owners might not bother to open the station at all. For customers to suffer from a gasoline shortage even while gasoline sat idle in the storage tanks of local businesses would be absurd. If higher operating margins are what it takes to tempt people to brave difficult driving conditions for the sake of opening the store on a day when customers are likely to be scarce, that’s a small price to pay.

Indeed, many of the problems associated with weather emergencies are precisely caused by the fact that we can’t count on shops to “gouge” their customers. I live in a neighborhood with buried power lines in a building that contains a supermarket on the ground floor. But I nonetheless found myself stuck in line Sunday evening at the Safeway stockpiling emergency supplies just in case something went badly wrong and knocked power out throughout the city. The issue wasn’t that I wouldn’t be able to get to the store in a worst-case scenario, as that I was afraid other people would already have bought up all the stuff. And indeed, by the time I made it, the shelves had been largely denuded of essentials such as bottled water, canned soup, batteries, and Diet Coke. Greater flexibility to raise prices would not only tend to curb overconsumption directly by encouraging people to buy less, it would inspire confidence that shortages wouldn’t arise, reducing the tendency toward panicky preemptive hoarding.

Last but by no means least, more price gouging would greatly improve inventory management. There is a large class of goods—flashlights, snow shovels, sand bags—for which demand is highly irregular. Maintaining large inventories of these items is, on most days, a costly misuse of storage space. If retailers can earn windfall profits when demand for them spikes, that creates a situation in which it makes financial sense to keep them on hand. Trying to curtail price gouging does the reverse.

None of which is to say that people should be greedy all the time. Disasters really are times when people pull together and we see large and small acts of kindness that rightly inspire us. But consider that declining to raise prices in the face of spiking demand and inelastic supply is a very odd form of charity: It doesn’t create any new resources, just allocates them arbitrarily to whoever shows up first. If you feel bad about the idea of earning windfall profits off the misfortunes of others, then donate the money to charity. If that seems too impersonal, give your employees a bonus for showing up under difficult circumstances. But storm or no storm, the best practice is to try to set prices that balance supply with demand. State governments shouldn’t be trying to stop you.