I think that price gouging is mainly a result of allowing too much consolidation via buyouts and mergers, and not actively enough perusing antitrust and anti price fixing enforcement.
I suppose if it's allowed to get too bad, the government could try to compete in the market, but governments are almost never the most efficient way to do things and can rarely effectively compete on efficiency against a functioning open market. In my eyes, regulation of the open market via labor law, protecting unions, trust busting and anti collusion enforcement is a far better way for government to solve this problem.
Unfortunately a government that's not functioning well enough to do this kind of oversight will almost certainly fail at trying to compete against in the open market as a grocery store too. At which point you are just running subsidized food banks, which is also fine by me but I don't think subsidizing all food for everyone will work in most government budgets.