Sure. So how do we determine who is an illegal immigrant? By looking at an illegally-obtained list of names and picking out the Hispanic ones for background checks?
The majority of European (and other) countries require everyone staying at a hotel be reported, so it doesn’t become the hotel’s job to determine illegal vs legal, it just becomes a huge privacy issue for everyone because the government knows everywhere you stay.