They are shipped to buyers in the little cups. My LFS keeps them in those cups until they are sold, and I used to think it was terrible, but now I work there and I can see that it's not as bad as it seems. The water is changed three times a week, and the fish are only fed three times a week to cut down on the waste produced. The fish are always colored up and active, and I hardly ever see one die or get sick- in fact there are less betta casualties than most of the other fish species there. I've bought quite a few bettas there and have never had a problem with any of them becoming unhealthy or dying later.
I'm not trying to make a blanket statement saying that it's fine to keep bettas in tiny cups. The water will much more quickly go south if regular changes aren't performed, which I'm sure they're not at many places, hence all the grungy water and dead bettas. It also makes customers think it's okay to permanently keep a betta in a tiny container, when these bettas are only in there for a couple weeks at the very most before they're sold off.
Would they enjoy having more space to swim? Of course. Would their water stay cleaner if they were in larger containers? Undoubtably. Will the owner ever upgrade them to better containers? No way. He doesn't make enough money on them to devote a larger space to them or buy them larger containers, and I think that's the issue with most pet stores that use them.