The Justice Department said it has opened a civil investigation into the conditions in New York City’s public housing.