About 5.5% of Americans don't have bank accounts and pay primarily with cash. Most of these people are impoverished minorities, specifically blacks and Latinos. Not accepting cash is a pretty discriminatory practice.
Handling cash is a hassle. It carries risk in terms of losing it, and it takes time to count it and transport/deposit it into a bank. All things that eat into your profit margin, in an industry that has crazy low margin.