A Queens homeless-shelter operation was found to have multiple unsafe conditions that could endanger small children — but the nonprofit that runs the dingy facility was still given hundreds of millions of dollars in public money, documents obtained by The Post show.

The city found that three-quarters of the inspected hotel rooms at an emergency shelter run by Childrens Community Services had problems, including broken cribs, tots sleeping in “unsafe” areas and no kid-proof covers for electrical outlets.

The Department of Homeless Services slapped CCS with a “poor” rating for its mismanagement of the operation — the second-lowest available.

The blistering review was the third such one that shelters run by the nonprofit have received, according to records obtained under the Freedom of Information Law. But the failed inspections haven’t stopped DHS from handing CCS more cash.

DHS quietly filed paperwork with the city Comptroller’s Office in January to add another $241 million to CCS’s hotel-shelter contract, which was already worth $359 million — bringing the total amount to $600 million.

The latest contract is not finalized, but if it goes through, CCS will have received $828 million in city contracts since 2014.

A DHS spokesman said the organization ordered the charity to shape up its operation following the failed inspection.

“We stand by our legal and moral obligation to provide shelter to New Yorkers experiencing homelessness and won’t allow providers to neglect their responsibilities to our neighbors in need,” DHS spokesman Isaac McGinn added.

The agency attributed the new spending on an uptick in hotel-room demand, triggered by efforts to close unpopular cluster shelters, which are located in private apartments.

City officials have announced plans to replace cluster and hotel shelters with permanent facilities. But plans for the new permanent shelters have been delayed due to opposition from surrounding neighborhoods.

The city has been required to provide shelter for anyone in need since the early 1980s.

“It’s a half-billion dollar contract and we need quality providers to be fixing this crisis, but obviously, they’re [CCS] not it,” said a person closely linked to the city’s social-service nonprofits.

Figures show that CCS is responsible for running 33 of the city’s 89 hotel-shelter operations. Approximately 11,700 homeless New Yorkers are housed in hotel shelters around the city.

Inspectors examined 80 of the 895 hotel rooms CCS rented from 20 hotels across Queens in December 2017 and January 2018.

The names and locations of the hotels were redacted in the documents provided in response to The Post’s FOIL request.