Because it isn’t as good for business as you think. First the business has to pay them, usually a good chunk of change, to be on the network, then they have to pay a percentage (usually around 3%) of each charge on that card to the card company. Most restaurants run at around 1.5% margin (the profitable ones at least). So you can see how 3% to the card company eat that.
Now of course you also have to add in inflation. Prices are going up all over, and customers are rebelling. Prior to this they just handled the card fee by upping prices across the board, so functionally non-card paying customers were paying “extra” but none of them noticed or cared. But when people are feeling the inflation pinch and changing their buying habits raising the prices gets tricky.
NOBODY is being punished for this. The businesses have just found themselves in a box. The market won’t flex around them charging more to everybody, and because of that their margins have shrunk even more. That 3% fee they have to pay the card companies is no longer being able to be absorbed. So they’ve got 2 choices:
stop taking cards
pass the cost to the customers using cards
It actually all makes perfectly good sense when you understand how the business of card transactions work.
If they lose half their customers, the 3.5% fee won't matter, they will go out of business.