Some countries require passport information for non-resident occupancy tax waivers. I'd expect that the hotel is required to maintain the information until whatever statutory period (on reporting, audits, etc.) expires.
It is all nice to speculate from a US-based kitchen, or office, or bathroom as to what hotels in non-US countries should and must do, but most of us have no idea what those local realities might be.