Textbook, your statement makes a lot of sense but I disagree. Walmart is a big benefactor of food stamps and other government programs. They also are known for having busy stores and still understaff it. Only on Black Friday all registers are open. Store can be busy and they have like 5 registers open but 10 self-checkout registers. Last, many of the stores closing are the biggest or few retailers in their area. The notion of them closing stores due to the recession doesn't make sense considering store are not losing business.
Like someone said above, Amazon set the standard of making a profit without a brick and mortar.
A lot of Walmarts were open years before Amazon started making strides without having to have a building to sell products. Walmart is basically rethinking its business model, so eventually they were going to close stores.