Subletting is entirely legal is it not? And it’s not a free ticket to do whatever you want with the property either.
The idea is they take the sublessee's deposit and first rent payment, don't pay the owner the rent, and vanish. The sublessee has now payed deposit + rent but has nowhere to live (as the landlord is unpaid).
This happened to my relative when someone owed her $9000 in rent. We were able to retrieve most of it via small claims court. It also helped he was dumb enough to leave bank papers behind when he was evicted so it made the process easier. A credit agency is handling the rest.