I don't think it is stupid or selfish to prepare for what may become a problem. If we can't get to the shops because we are ill or self-isolating, we will still need to eat, so it makes sense to have extra non-perishables in stock in case they are needed - how is that stupid?
Supermarkets work on a just-in-time basis, and deliveries are triggered by sales. If people buy more pasta, more pasta will be automatically ordered, so if I buy a couple of extra bags it won't mean that you will be short by a couple of bags - it doesn't work like that, so I can't see how it's selfish either.
As I said on another thread, I was brought up to believe that good housekeeping means being prepared for (unspecified) emergencies, and in the event of fire, flood or disease at least I won't be adding famine to the miseries of my family. It's not as though I would let things go to waste, either. If anything is not used it will go to the foodbank before it gets near its use-by date.