Is this even illegal if the amount you get charged is the amount it says you'll get charged?

Is it legal for waiters to surreptitiously record your card number while processing payment? Because that's what basically it is

Yes. This is wire fraud. It is absolutely illegal. Even if they weren’t impersonating a business, charging someone for services or goods with no intent to provide them would still be fraud.