My LFS sells bettas kept in much better conditions. All of their fish are either in standard display tanks with dividers, are kept with other fish they get along with and some even get to cruise the huge plant tanks by themselves.
I went to a local Wal-Mart recently and witnessed the same sort of thing you saw. My local Petsmart and Petco both have the small containers with bettas, but have higher turnover rates so the fish there all look pretty healthy. At both stores I've also seen large containers of betta food at employee workstations, indicating that they receive some basic level of care. Wal-Mart, on the other hand, is a completely different story. What a nightmare of a place that must be for fish. I sometimes buy ghost shrimp from Wal-Mart, and the employees there don't even pretend to know what they're doing. I really wonder how any fish survive there. I saw dead bettas in cups full of disgusting water not even deep enough to swim in. The sad thing is, a store like Wal-mart isn't even a pet store, so they really don't have to worry about losing business due to customer dissatisfaction like the bigger pet chains do. In time, hopefully, Wal-Mart will stop even attempting to sell bettas. They can't possibly be making money if the fish are sitting on the shelves long enough to dry up.