Walmart already has grocery warehouses with their stores, so bolting on pickup/delivery to those makes sense. I don't know how much pickup/delivery could potentially negate the need for the store, but I'd assume the pickup/delivery load of a store has huge room for growth before you start questioning why the store needs to be open to the public.
I haven't used their grocery delivery service but their pickup service is well-executed and convenient, in my experience, so I'm assuming they can figure out how to be competent in delivery as well.