Mayor Bill de Blasio has been running for (giggle) president of the United States for awhile now, flitting about America, hoovering up humiliations that would crush a lesser ego.

He’s been the regular butt of vicious late-night humor — and how many progressive Democrats have to suffer that?

He managed to get himself shouted down by President Trump’s supporters in — of all places — New York City, another singular achievement.

An eye-popping 78% of New Yorkers polled by Quinnipiac University say he should just stay home.

Staff and media folks routinely outnumber fans at campaign events — it would overstate things to call them rallies — sometimes 2-to-1. (He might someday draw an appreciative crowd, but probably only if he set himself on fire.)

He has taken to Facebook to beg for enough support to qualify for a Democratic debate spot.

But his polling support among Democratic voters stands at a nice round number — zero — so that’s not likely to happen.

So what’s it all about? Why is he doing this to himself?

Doubtless for the same reason he motorcades from Gracie Mansion to the Park Slope Y for his daily exercise — because mind your own business.

That is, he’s running because he feels like it. And because it beats the hell out of the deadly boring grind of running a vibrant, but increasingly troubled, great city.

Certainly not because a presidential run makes any objective sense — and absolutely not ­because it offers even a remote possibility of success. It’s because he wants to, and whatever this arrogant, self-indulgent fellow wants to do, he does.

Consider:

l De Blasio wanted to be a fund-raising hero to Democrats — but his casual contempt for campaign-finance laws kept federal and state investigators busy for most of his first term. And now associates from that period are beginning to go to jail.

l He wanted to shine among progressives, so he turned over control of most city welfare policy to hyperactive social engineers, and now the shelters are bursting, and the streets are overflowing with dysfunctional panhandlers and the hapless — hopeless — mentally ill.

l And he wanted a high-profile government gig for first lady Chirlane McCray, so he peeled off several hundred million dollars (and counting) to fund ThriveNYC, her competing ­approach to municipal mental-health policy. A spectacular, continuing fiasco ensued.

A sensible politician with a record such as his — and there are many more details where the above came from — would do his best to keep it in the closet.

Yet here is de Blasio, rolling it out for all to see. It makes no sense at all — except to those who understand that Hizzoner, in addition to his self-indulgence, is ­utterly impervious to personal embarrassment.

Thus the mayor soldiers on. He was off to Iowa Thursday to support striking McDonald’s workers; was scheduled to drop by City Hall afterwards (doubtless to pick up his paycheck) and then was bound for Nevada for the weekend.

And for those still wondering why, the answer is because he’s bored, because he can, because he wants to and because New York City has been on auto-pilot for ­going on six years now without flying into a mountain.

That last could change any day, of course. In the one week since de Blasio’s formal campaign declaration, a clutch of vicious teens beat the hell out of an off-duty FDNY firefighter, apparently just for chuckles. A fellow was spotted hand-feeding his pet rat on a packed subway: Why not? The trains are becoming the world’s longest rolling vagrant encampments anyway. And a bum began homesteading in the shadow of the 9/11 memorial, scandalizing tourists.

Plus — and this is no joke — The Post has just revealed Schools Chancellor Richard Carranza to be fomenting race riots at the Department of Education, where erudition is tantamount to “white supremacy.”

New York City clearly needs a mayor. It has a ridiculous presidential candidate.

Bob McManus is a contributing editor of the Manhattan Institute’s City Journal.

Twitter: @RLMac2