How is that legal not to accept cash?
Blocking unbanked people from the economy is sorta bad if you have any kind of homeless population.
If you ate, and tried to give the restaurant $50 cash to cover the bill, what's the restaurant going to do? Call the cops? The cops will just tell the owner to take the cash or forget about it.