I mean, cash is also expensive in its own way. It has to be handled and insured, coins may need to be rolled before being taken to the bank, a register is a mechanical device to power and maintain, petty theft by employees is a concern.
It's not really that hard to see why a business charging $5-20 per transaction from people who all have phones and credit cards anyway might choose not to accept cash.
You think the owner is taking the cash to the bank?? Unless they are an one-person operation, they likely have an employee do it (among their other duties).
Transporting and handling cash is absolutely not free, and unlike joe sixpack taking out $20k in a stack of benjamins that one time to buy a motorcycle with cash, it's much worse when
a. a lot of it is coins, so it's heavy and bulky, and
b. it becomes a regular thing that everyone on the street observes you doing over and over
It's not really that hard to see why a business charging $5-20 per transaction from people who all have phones and credit cards anyway might choose not to accept cash.