This is why the meme about Walmart is subsidized by the government is completely preposterous. With Walmart was forced to, they could restructure their company to support the Costco model and lay off a million people.
I'm not so sure it's that simple. Costco has higher revenue per employee because the price per item is much higher. The customers who can afford to shop like this are comparatively much wealthier than those who shop at Walmart. That being said, Walmart does exactly this with their Sams Club locations. It's certainly a profitable business model, but the market is smaller than the customer base that Walmart serves.
While a middle income person might be able to buy a month's worth of groceries at one time, and fill their freezer and pantry, lower income people often do not have the cash flow to afford making grocery trips that large. Even if the unit price is slightly higher at Walmart, they have no other option, because they can't afford to buy $50 of beef at one time if their entire shopping budget $50.