Economists have reasonable arguments against laws that prohibit hoarding and price gouging. But often they get carried away and take those arguments so far that they're arguing that nobody could ever be a jerk for doing those things -- that, say, a store owner who raises the price of flashlights after a hurricane is always doing the right thing.
The basic argument is that if he keeps flashlights at the normal price they'll quickly sell out, whereas at a higher price they'll last longer and the people who will buy them will be the people who need them the most. It's a reasonable argument, but it's missing a key piece: it doesn't tell the store owner how much to raise the price.
If he raises it too much, the flashlights will all go unsold, and he won't be doing anyone a favor -- not even himself. He'll just be being so much of a greedy jerk that it's self-defeating. At a somewhat lower price, he'll be the sort of greedy jerk who makes a lot of money: he'll have lots of flashlights left over, but on the ones that did sell he'll have made a killing. At an even lower price, he'll sell them all and only run out just before his next resupplies come in. This might be thought of as optimal, but that is of course in the eye of the beholder. And hitting that "optimum", or pretty much any other "optimum" that might be preferred, would demand not only knowing when exactly more flashlights will come in (which is not always known after a hurricane), but also on the vagaries of local opinion -- not only on how many people need flashlights, but on how scared they are and thus how willing to pay higher prices.
If the store owner keeps the normal flashlight price, he might sell them all to someone who then re-sells them at a higher price. (A law against price-gouging might not even prohibit this: price gouging is commonly defined as raising prices, and someone who was not selling flashlights in the first place has not raised his prices, since he didn't previously have prices.) If more flashlights will arrive soon, this actually might be the way for the store owner to make the most money: sell the current stock of flashlights to the profiteer, let him hang onto them in anticipation of higher prices later, and then sell more flashlights to everyone else, leaving the profiteer out of luck.
There are of course other possible strategies a store owner might take, such as letting each customer buy one flashlight at the normal price but asking for more money for subsequent flashlights, "so that there are flashlights left for others". That's the solid core of the argument against laws that ban price-gouging: they impose a fixed rule on a situation where really the best thing to do is a difficult judgement call. What those laws demand is the right call when there is plentiful supply, but that might not be the case.
The situation for hoarding is similar, although laws against hoarding tend to be a feature of truly tyrannical regimes, rather than (as with price gouging laws) something even relatively free societies do. One reads, for instance, that in the Ukraine famine of the 1930s, people who weren't visibly starving were "suspected of hoarding". But as evil as the people who engineered that famine were, it nevertheless is possible to be a jerk by hoarding: when something is scarce, buy up a large amount of it, more than you'll ever need, and then just sit on your hoard until after the scarcity is over.
The non-jerk way of hoarding is to buy when supplies are plentiful and cheap, and then share with others when they are scarce. This can even be profitable. But it requires more than average foresight: the above 'jerk' may be trying to be a non-jerk, and just thinking the scarcity will get much worse, until he is eventually forced to admit that plenty has really returned again and that he has not only worsened the scarcity for others but also lost his own money.
As with price gouging, though, there are intermediate scenarios in which the hoarder may make a lot of money while still being a jerk. And as with price gouging, choosing the best thing to do can be a difficult decision. In a way it can be pleasant to have the government take the decision away from you, but the consequences of having the decision made in a thoughtless, predetermined manner are likely to be not at all pleasant.