This is done in some instances, notably the strategic petroleum reserve.
But that is basically a special case, as petroleum is so central to the logistics of basically all economic activity.
But with ... groceries? The main obvious problem is expiration dates. You can do this with food that does not perish so quickly, but thats like a hold over from great depression/cold war/nuclear apocalypse type policies.
It would still be a massive logistical effort to distribute even dry goods or preserves.
Currently we can barely operate a postal service and have the developed world's most laughable 'public' train service.
Most industries, and groceries in particular, run on Just In Time delivery, ie, grocery stores get the food they are selling tomorrow on trucks that come in that night.
It is far, far easier for the government to say, eh you cannot raise prices by more than x amount in y amount of time, and then just monitor them, than it is to undertake a massively complex logistical endeavor.
If you wanted to do that, you would just nationalize Walmart and Amazon and Kroger.
But this is America, and that's c o m m u n i s m!
We don't even have actual government run internet even though the government basically fucking invented it, its basic infrastructure at this point, nope, we just give the corps a whole bunch of money to build out infrastructure, and then they don't do that and pocket the money instead.
They would still be Amazon, Walmart, and Kroger. The government would just own a controlling stake and sit back except to require that these companies carry enough inventory of certain products. However, I don't believe that a government can only do things badly. There are plenty of current and historic examples of how that doesn't have to be the case.