A D.C. Superior Court judge on Thursday ruled that all homeless families that have been staying in a makeshift shelter on frigid winter nights can join in a lawsuit alleging that the city’s emergency housing is inadequate.

Judge Robert D. Okun, siding with four families that filed the initial complaint, expanded the suit into a class action to include…