Regrets? Paul Ryan has had a few, he admitted recently.

The big one, he confessed, was government’s failure to get a headlock on the national debt, which has mushroomed to $21.7 trillion.

Yes, he said it without irony.

Which is like Wayne LaPierre of the National Rifle Association lamenting America’s obsession with guns by passing out more bullets.

When he leaves office in four weeks, Ryan will have been House speaker for three-plus years. He also chaired the House Budget Committee for four, and throughout his two decades in Congress he has led a vociferous Republican chorus as it fumed about how debts and deficits would devour us all.

Yet as speaker, he presided over a gluttonous rise in spending that will explode the debt for the foreseeable future. During his tenure, the amount of outstanding federal debt grew by just over $2 trillion, and the federal deficit expanded from $438 billion in the 2015 fiscal year to $779 billion in 2018.

It was just the latest reminder that for all the spluttering Ryan has done about debt, his legislative record — notably the gargantuan tax cut and massive military spending increase he consecrated last year — only added to it, and left us in more jeopardy than he had ever imagined.

Because of Ryan’s warped political priorities, the Congressional Budget Office estimates that the 2019 fiscal deficit will be $981 billion. In 2020, it will exceed $1 trillion for the first time since the depths of the financial crisis, and it will likely stay there at least through 2028 — even if the economy is good.

Regrets? We wonder.

As he departs, Ryan’s legacy among those outside the donor class will be that of a Wall Street cheerleader and two-bit charlatan who tried to sell himself as a credible policy wonk.

But he should be remembered for his contempt for the middle class, which has been nothing less than prodigious: Leading a caucus that routinely whined about the welfare state and an imminent fiscal apocalypse, the only deficit-reduction plans Ryan ever touted included gutting social ills such as hospice, school lunches and Sesame Street.

Put it this way: When Newt Gingrich condemns your budget as “right-wing social engineering,” it’s a fair clue you’re taken this Ayn Rand fanboy stuff too far.

He’s going out in style. His tax plan — a bonanza for the rich, which fulfilled “a lifelong dream” — never called for any offsets such as spending cuts or revenue increases. So it was hardly surprising that in March, Ryan said we must explore cuts to Medicare, Social Security and food stamps to compensate for those tax breaks. Because deficits.

And nobody has worked harder to make Donald Trump’s wildest plutocratic dreams come true, the fulfillment of a prediction author David Frum made in March 2017, when he wrote that the leader’s caucus will “find itself conscripted into serving as Trump’s ethical bodyguard.”

The president never had many policy ideas, but Ryan realized that only scandal could destroy everything the Republicans Party had sought to accomplish. So he ignored all of Trump’s greatest hits — the hostile tweets, the ethical lapses, the conflicts of interest, the manifest cruelty on everything from immigration policy to health care to the tax code.

Ryan had learned his greatest lesson after refusing to campaign with Trump in the aftermath of the Access Hollywood debacle. In just 10 days, the speaker’s favorability rating among Republicans crashed 28 points. He never made that mistake again.

The rest is infamy. Nobel economist Paul Krugman calls him the flimflam man. We disagree. Men have backbones, and in the aftermath of failure, genuine regrets.

Bookmark NJ.com/Opinion. Follow on Twitter @NJ_Opinion and find NJ.com Opinion on Facebook.