I do believe this is a policy failure and that a law should exist mandating cash acceptance “for all debts public and private”, but there is nearly zero chance of such a law ever passing in the US.
Even where it's "technically" possible, it's becoming more difficult. Some grocery stores around here don't staff traditional teller lanes at night, shrinking down to only self-checkout, which are card-only machines. To pay cash, you'll have to escalate to the roaming attendant (or at least, I assume they can find some way to accept cash for that transaction? I can't say I've tried)
I think some theme parks have started. Not accepting cash should be illegal, and certain places have started implementing laws that make the practice illegal. There are various reasons why a person is unable to have a bank account.
At the market, there is a high cost to managing cash and so some of the small sellers will only accept cash reluctantly or not sell because they can't break notes.
Used car? Bank transfer.
I think the other part is speed. They know the cost, type it into a machine and then tap to pay, onto the next customer!
It is also safer than carrying loads of money on you while you sell stuff on the street.
Guarantee any individual market stall seller would rather take exact cash than not make a sale at all. Small firms might not, since their cashiers have to work in the process the owner sets. Owner-operators will do anything for money or soon go out of business.
This is a particularly American view, a sort of extreme pessimism about the risk of their government collapsing into fascism; while I can see the point in the Trump era, from a practical point of view I'm much worse off with corporations seeing my card transactions. Which includes the card issuers themselves, censoring certain types of locally-legal business.
Average American is more at risk of hassle from Equifax seeing their transactions than even ICE seeing them.
Even worse with the alt payment systems. There's a long list of things it's dangerous to say in a Paypal transaction description. Venmo make transactions public by default, which is insane.