We will all suffer if masks and basic hygiene products aren't allocated well.
There is not enough time to solve the coordination problem (or, more accurately, we solved it in advance).
The government elected by most market participants steps in (or threatens to step in) to help maintain order. This seems like a less crazy idea than seeing how many nurses will pay $500 for a mask.
Market participants are unable to deliberate on every policy position of every candidate that they have to choose from in elections.
Elections as currently administered are highly limited in their ability to produce good collective judgments, so the fact that politicians support sonething is no indication that it's socially beneficial. If the democratic process produced socially optimal governance decisions, no democracy on Earth would institute rent control for example, and we see the opposite in practice.
And yes, if the shortage for masks is so severe, that they would fetch $500 in a free market, we need prices to spike that high, to spur massive rapid restructuring of the economy to ramp production of masks and alleviate that shortage.
Capping the price doesn't solve the fundamental problem, which is the shortage. It interferes with the process of solving the shortage.
The non-market solution doesn't solve the fundamental problem it prevents the problem from doing maximal damage in a time sensitive situation.
It takes time to build and staff and supply a mask factory, meanwhile you risk the scarce (in the best of times), skilled clinicians getting sick en masse or abandoning their jobs.
Market solutions work when there is no coercion besides price, unfortunately viruses won't take checks, nor will people who are fearful or desperate.
That kind of extreme situation can be dealt with far more targeted regulatory responses than price controls, like simply commandeering private supplies when medical professionals need them during a critical shortage, and some monopolist is refusing to sell them.
And in most situations, money can solve the problem, and get the essential item in the hands of those who need them. Those with stockpiles typically have them in order to sell them during a shortage. Not pointlessly hoard them and forego the profit earning opportunity.
The long-term damage of anti-price-gouging laws is fewer stockpiles to prevent shortages from emerging during future crises, and a slower ramp up of production and distribution when a shortage does emerge.
There is not enough time to solve the coordination problem (or, more accurately, we solved it in advance).
The government elected by most market participants steps in (or threatens to step in) to help maintain order. This seems like a less crazy idea than seeing how many nurses will pay $500 for a mask.