Most of the stores are optimized for in store shopping. What this means in practice is that the actual back rooms where the products are stored are relatively tiny (on the order of less than 10-15% the floor space of a typical Supercenter). The whole operation is designed so that the trucks can be unloaded as quickly and efficiently as possible, and most of the stuff can be stocked straight on the shelves where it is available for purchase. Inventory held in back rooms are minimal, and all the items in the entire store turn around extremely quickly.
Contrast this with an e-commerce warehouse, which has to deal with a large 'long-tail' of demand. People are used to having a huge range of choice available, and they expect same or next day shipping on whatever they order. Now instead of having say 20 boxes each of 8 different kinds of toilet paper now you need maybe 10 boxes of 100 different kinds, and they all have to be organized such that they're easily accessible to the packing crew. To make an efficient warehouse, you simply need a different layout and assortment of products than is available in your average store. At the same time, the stores continue to generate the vast majority of revenue for your business so you can't mess up their operations too much.
Not implying that it is an impossible problem to solve, simply a difficult one. I'm sure amazon will run into similar issues as they continue to integrate whole foods.