It is not unlawful but can be very problematic. Free to carry on if you think your method is workable.
I only venture to add some comments:
From the way you have described it, I can foresee plenty of problems.
If I were the landlord, I will not want to enter into an agreement with the 5 Bangladeshis. I would prefer to deal with the company.
Secondly, I think if you want to provide housing for them, do it in a straight forward way: rent a house, provide all the facilities like beds, mattresses, cooking stove etc etc, select one of them, preferably one who is respected by the others and can speak English, to be the leader/supervisor/big brother or whatever to be responsible to the others. Make him responsible for cleanliness, discipline, water/lighting wastage and so on. Should there be any problems with them, the company will go for the big brother. You just cannot leave matters to themselves.