Short answer. Yes. The Civil Code gives a hotel-keeper the right to retain the things a guest brings into the hotel as security for what is owed on lodging and the usual supplies furnished to guests. This is a lien tied to the debt, not a punishment, and it lasts only as long as the bill is unpaid.
What the law says
The hotel-keeper has a right to retain the things brought into the hotel by the guest, as a security for credits on account of lodging, and supplies usually furnished to hotel guests.
Civil Code, Article 2004 — Hotel-Keeper's Right of Retention. Read the full provision →
A right of retention, not a right to sell or keep
Article 2004 grants a right to retain, which is a security device — the hotel-keeper may hold onto the guest's belongings until the debt is settled, but retention is not ownership. The purpose is to give the hotel leverage to collect what it is owed, not to punish the guest or to convert the luggage into the hotel's property. Once the credit the retention secures is paid, the basis for holding the belongings disappears and they should be released.
What the lien actually secures
The right attaches to credits on account of lodging, and supplies usually furnished to hotel guests. That ties the lien to charges connected with the stay itself — room charges and the ordinary supplies a hotel provides its guests — rather than to any debt a guest might separately owe the establishment. A dispute over an unrelated charge, or one the guest is contesting as not actually owed, sits differently than an undisputed lodging bill, since the retention is meant to secure specifically the kind of credit the article describes.
What is covered
The article speaks of the things brought into the hotel by the guest, which is broad enough to include ordinary luggage and personal effects a guest brings for the stay. It is the guest's own property carried into the hotel that the lien reaches — the provision is about holding what the guest brought as leverage for the guest's own account, not about hotel property or items belonging to someone other than the debtor guest.
If you think the hold is being misused
Because the right exists to secure a specific debt, the amount actually owed matters. If you dispute the bill, or part of it, get an itemized statement so you can see exactly what charges the hotel says the retention secures, and pay or resolve what is genuinely lodging-related to remove the basis for the hold. Keep records of any payment made and any correspondence about the dispute, since that is what will show whether the debt the retention was securing still exists.