Why did it take inquiries from The Post to get the city to break up a homeless encampment right off Times Square? Because Team de Blasio just can’t face reality.

For months, cops did nothing as a homeless contingent turned the area beneath a building scaffold into an encampment. City Hall claimed that the squatters’ camp was kosher because it didn’t violate the mayor’s 2015 policy barring the erection of structures on public sidewalks.

The idea was that cardboard “structures” didn’t count — even though they make the same claim on public space as ones using wood or other materials.

Locals complained, but nothing changed until The Post started asking questions. Then City Hall dispatched cops to break up the illegal shantytown and put up barricades to discourage their return.

Shades of 2015, when our reporters and photographers had to point out encampments all over the city, and print the proof in the paper, before City Hall and the NYPD got moving.

“We’re not going to tolerate homeless encampments,” Mayor Bill de Blasio announced back then. Yet somehow, with the passage of time and public distraction, they started doing just that.

Expect more encampments to turn up: If one can last for weeks in one of the most visible parts of the city, others have surely benefited from the same official blindness.

City Hall’s loyalty to misguided ideology keeps trumping common sense.