You can’t be serious.
Nobody is withholding an expat’s passport while they live in boxes with 16 other people and working for months on end.
You’re making ridiculous comparisons and it makes me dubious of your intent here.
Even if they let you keep your passport, you still need an exit visa to leave. I've known wealthy upper class people to get stuck in the country for a bit because they had a dispute with their employer and the latter then refused to sign the paperwork so he could get an exit visa.
Putting 16 people in the same "box" is also illegal and, frankly, I've never seen laborers being treated like that. I think you are making this up or referring to an outlier case.
Laborers have two options: take care of their own housing or live in a employer-provided accommodation. Bankers, obviously, choose the former, taxi drivers choose the latter. There is no law that says taxi drivers should be treated differently than bankers.
It helps if one imagines Dubai as a cruise ship: expats are treated as a typical cruise ship crew. Some sleep in bunks next to the engines, some pay to live in better rooms on higher decks, but the approach in general is the same. Each member of the crew is there temporarily and they know it. They are expected to do their job and leave once its over.