Because very often the override code hasn’t been reset, and those are well-known, If it hasn’t been, you might as well leave anything you had in the safe sitting out in the open.
Secondarily, most hotel safes also have a key override that is stupid easy to pick and leave locked after the safe has been gone through: In-Room Hotel Safe - YouTube - arguably that’s even worse than the override code, because that resets your code. The key silently unlocks and relocks the safe without your knowing it happened.
Here’s the Lock-Picking Lawyer finding a THIRD override; card-swipe safes can be programmed to accept an override swipe card when they are open. Anyone with access to the room while the safe is open can program in such a card, such as maintenance or housekeeping. This function can be disabled…but the enable/disable function isn’t password protected! [1217] Mesa Hotel Safe: Three Vulnerabilities - YouTube
Basically, you cannot trust the safe is safe from anyone other than the most casual thieves.