Stacking that stuff and CC rewards can save you several percent of your retail spending a year. Paying cash is like paying sales tax twice.
[EDIT] to be clear, you effectively pay more to not be tracked in general, not just for avoiding a CC. Loyalty cards get you regardless of payment method. Also, lots of stores try really hard to get you to take "their" credit card (god, Target won't shut up about it) with unusually good rewards or discounts at their store. You can bet they get access to those data, including when you use it other places, even if Visa or MasterCard services it (and also gets the data)
We don't know Walmart's feelings, they may like the arrangement. Business go cash free for all kinds of reasons. Customers that use credit spend more money than cash customers. Walmart probably isn't one of those places that benefit as much as a pub but they may have a small credit spending boost that covers the fees.
Walmart is a really smart and data driven company and I'm sure they've weighed their options about what is effective business practices for them.
[0] http://time.com/money/3541247/apple-pay-walmart-current-swip...
And as mentioned elsewhere, cash has a cost as well (theft, miscounting change, counting in and out cash drawers during shift changes, arranging daily deposits, trips to the bank, etc). As someone who worked retail 10+ years ago, I can assure you all these things happened, and probably added 2-3% to costs vs electronic payments.
That last article quotes it at up to 3% but most say 2%, so I am assuming there is a percentage and a fixed cost, and possibly a cap. In any case Walmart had a long history of being very unhappy with the relationship.
[1] http://mobile.reuters.com/article/idUSBREA2Q2BJ20140327 [2] https://mobile.nytimes.com/2003/06/06/business/merchants-may... [3] http://www.computerworld.com/article/2839144/heres-why-rite-... [4] http://time.com/money/3541247/apple-pay-walmart-current-swip...
Interestingly, the discounts are usually not on the "exclusive" items, but on basic necessities - like vegetables.
Also, the shop in question didn't even have debit/credit card readers until very recently. I suppose stores may be reluctant to pushing people into card payments simply because processing fees are too large if you're running on small margin.