The MTA this week announced it will create a task force aiming to reduce the number of homeless swarming the subways. Good — but it sure looks like the agency had to be shamed into it.

After all, that news broke just a day after state Comptroller Tom DiNapoli reported that his auditors had caught massive shirking by a nonprofit that’s paid to help get homeless out of stations and trains. It looks like MTA managers didn’t even check on whether the Bowery Residents’ Committee was delivering as promised on its $8 million contract to “conduct homeless counts . . . outreach and placement.”

Indeed, MTA Inspector General Carolyn Pokorney confirmed DiNapoli’s findings that the nonprofits workers were spending just a quarter of their time doing in-person outreach, about half the work the contracts required.

With offices in Penn Station and Grand Central Terminal, as well as in certain LIRR and Metro-North stations, the workers even hid behind “closed” signs as homeless people knocked on the door to seek help.

Something to think about the next time you board that uptown A train and have to stand as a guy who hasn’t bathed in a year sprawls across four seats.

Gov. Cuomo raised the issue weeks earlier, saying, “It is a crisis, and it has been for a long time, and it’s only getting worse,” as he urged the MTA board to tackle the subway’s homeless problem in its reorganization plan. In 2018, he noted, about 650 trains “were delayed because of the presence of homeless people.”

To be fair, the problem goes beyond the MTA. Both Amtrak and the NYPD seem helpless in the face of affairs around Penn, where beggars and vagrants (not necessarily homeless) often dominate the entrance areas. And Mayor de Blasio’s Thrive initiative has plainly failed to give homeless the mental-health help it should.

As always, everyone concerned is vowing to treat the homeless decently: The MTA plan (to be drawn up in partnership with the NYPD Transit Bureau, MTA Police and the state Office of Temporary and Disability Assistance) is to center on “housing alternatives and increased resources.”

Absolutely be kind about it — as long as you get serious about reclaiming these public spaces for their intended purposes.