At some point this winter, boiler malfunctions have caused more than 80 percent of New York City’s 400,000 public-housing tenants to lose heat or hot water. As Mayor de Blasio sees it, the fault lies with . . . Ronald Reagan, for having reduced federal funding for public housing starting in 1981.

It’s not all Reagan’s doing, though; The mayor also blamed Newt Gingrich and the 1994 GOP Congress, along with Rudy Giuliani and Mike Bloomberg, the Republican mayors who preceded him. He ended by blaming Gov. Cuomo and New York state for failing to make up the $20 billion shortfall in NYCHA’s capital budget.

De Blasio did not accept any culpability for himself or his administration, but he said that he has invested $200 million in new boilers at 20 developments. This just scratches the surface of the problem.

When asked how he’d respond to a private landlord who failed to provide heat or hot water to 80 percent of his tenants, the mayor bristled. “The private sector profit motive,” he explained, “has an entirely different orientation and typically has a lot more resources to work with, as opposed to the public sector that’s here to serve people, in this case working people, low-income people in this city.”

NYCHA’s mission, he said, “is a very different reality than what the private sector faces,” because private, for-profit landlords maintain “buildings that were built for upper-middle-class people, for example, or well-off people.”

Contrary to de Blasio’s formulations, New York City’s rental-housing stock is not divided between low-income people who live in distressed projects and upper-income people who live in well-maintained private buildings. Privately owned, rent-regulated apartments number about 1.1 million across the city, housing a wide spectrum of people of all income levels.

Another 1 million rental units are unregulated, and these also house a broad range of people, most of them not rich. More than two-thirds of New Yorkers rent; 44 percent of New Yorkers live near the poverty line and less than 5 percent live in NYCHA housing.

Clearly, lots of poor and near-poor people rent in the private market, both regulated and non-regulated. De Blasio is way off-base to suggest that the private housing market primarily serves the privileged.

It’s true, though, as the mayor suggested, that for-profit landlords operate at a different standard when it comes to service. Indeed, private landlords who allow their tenants to freeze in the winter may face severe penalties — fines amounting to thousands of dollars, rent reductions and perhaps city intervention to remedy the problem directly, for which the landlord will have to pay prevailing-wage and city-contracting costs.

Private landlords don’t get to blame Washington for their faulty boiler systems. They have to fix them.

Moreover, while de Blasio complains about the “much greater resources” that the private-rental sector enjoys, he has done everything in his power to limit those resources. The mayor-appointed Rent Guidelines Board froze regulated-rent increases for two consecutive years before allowing a small increase last year.

The mayor has expanded the definition of tenant harassment to include contacting renters about buyout offers, and he has made it more difficult for landlords to evict troublesome tenants.

De Blasio’s conception of how the profit motive works shines an ironic light on public housing’s failures. When American public housing was designed in the 1930s, the absence of a landlord gobbling up profit was touted as a virtue; all profits, in this classically Marxist line of thought, would go toward tenant services. Public housing would be self-sustaining. Rents would cover operating and maintenance costs.

That didn’t happen, of course, and NYCHA’s current dysfunction derives from a vicious circle whereby decay and decline have driven out people who can afford to do better. They get replaced by tenants whose sliding-scale rents don’t meet the costs of upkeep.

In saying that NYCHA residents are damned to be the city’s charity cases in the absence of a private market that will house them, de Blasio inadvertently raises a question that it would never occur to him to ask: Why not free up the market and give all tenants the chance to get a landlord who might give them heat?

Seth Barron is associate editor of City Journal and project director of the NYC Initiative at the Manhattan Institute.