On a recent summer day in Kuwait, as the temperature soared above 110 degrees, four Indian migrant workers stood by the side of a road with their belongings stuffed into bags.

Suresh Kumar, 52, and his roommates had just been evicted as the authorities swept their neighborhood for building code violations after a fatal fire in June that killed 49 migrant workers, the vast majority of whom were Indian. The four men said they had shared a 172-square-foot room on the ground floor of an apartment building, but inhabiting the ground floor is prohibited, so the owner was demolishing the room.

Now they were homeless, and unsure of where to go.

Kuwait, perched on the Persian Gulf, is one of the richest countries in the world, with a $980 billion sovereign fund built on oil revenue. But little of that wealth is enjoyed by migrant workers like Mr. Kumar and his roommates, who often struggle with inadequate housing and low wages, and who have limited power to seek recourse.

Mr. Kumar and his roommates were all construction workers subcontracted on projects for Kuwait’s state oil firm and refining company, and they said they could afford to pay only about $325 in rent between the four of them. Because a whole apartment would cost more than twice that amount, they were resigned to finding themselves another room to share, with no guarantee that it would be any safer or more comfortable than their old home.

The high death toll from the fire in June — which engulfed a seven-story building where nearly 200 migrant workers lived — shocked people across Kuwait. In the weeks after the tragedy, it spurred an unusually public reckoning over unsafe housing for migrant workers, as inspectors fanned out to issue building code violations.