Is it illegal for hotels to scan passports?

No.