The point is to serve as a disincentive to ordinary people thinking "Oh, I can make a lot of money doing that."
It crossed my mind, when news of the coronavirus first broke, that I could make a lot of money speculating in toilet paper, canned goods, rice, and beans in the near future. (I did all my prep shopping 3 weeks ago, but didn't buy more than we personally needed as a family.) I didn't because a.) a little voice in my head said "Do you really want to be that asshole?" and b.) it occurred to me that it was very likely that powers that be (governments and market platforms like Amazon) were going to crack down very hard on scalpers, and it was not worth going to jail for. Turns out I was right about that - people are not going to jail (in the U.S. at least, I heard they may be in Europe), but they're facing $5000 fines per item or eating the cost of buying & disposing of the items because Amazon revoked their seller license.
The point of highlighting laws like this is so that people aren't tempted next time there's emergency to do the same thing.