What does economics say about "price gouging" during an emergency?
Actually economics does not even officially use term price gouging. Your analysis is right, actually economists dislike anti-price gauging legislation for this reason. 

For example, when the IGM panel of top policy economists were asked about one piece of price gouging legislation in the US, vast majority disagreed with it:



However, an important caveat to keep in mind is that due to menu costs some firm would not be able to change prices quickly enough even in absence of anti-gouging regulation - meaning such regulation is not the sole source of shortages, there would be some even without them although less severe (and of course it goes without saying this is not any justification for them).

However, beside that yes, you are actually missing the main factor that justifies the anti-price-gouging legislation. Which is moral philosophy. There is argument to be made that such practices as gouging are immoral (you can see some ethical arguments against gouging in this paper for example). While I personally dont identify with such moral views, its not our role as economists to pass moral judgements. If people pass anti-gouging legislature well aware of all the negative economic consequences but they still do it despite them then there is no objection an economist can make against them as we are scientists not moral philosophers and such questions are beyond our discipline.