Credit card is a proxy for an acceptable credit score. It's a filter so they can exclude irresponsible people without exposing themselves to claims of discrimination or racism.
Unfortunately people who simply choose to live without using credit are caught up in that too.
Back when Russia had Visa and MasterCard, debit cards issued by our banks counted as credit cards as far as the payment systems were concerned. I'm sure there are other countries where this is the case.
I had that happen in Portugal when I was refueling my scooter, the Galp gas station tired to take 100€, which I didn't have to it took everything it could, but then said that I don't have enough money to pay, even though it was less than 10€... I had to pay with cash and I didn't see the money that was taken on my debit card for almost a month...
You can easily book at big chains in the US as a foreigner despite having no credit score whatsoever so I don’t think that’s it. I guess it’s probably just that a having credit card and an id card ensure that they won’t have trouble charging you if they need to. The possibility alone is probably enough to deter most people who could be tempted to commit petty things like stealing towels.