In a country that let presidential near-assassin John Hinckley walk free, it was absurd that hotel genius Ian Schrager was, until now, denied the right to vote because of a 37-year-old tax conviction.

Former President Barack Obama’s pardon of Schrager last week was the rare, laudable act of mercy among a bunch of deplorable clemencies that included freeing FALN terrorist Oscar Lopez Rivera and Gov. Cuomo’s sentence-shortening for 1981 Brinks massacre getaway driver Judith Clark.

Schrager’s overdue pardon stands out for its common sense and respect for the spirit of justice. Schrager did 20 months behind bars starting in 1981 for evading taxes at Studio 54, the legendary disco he founded with partner Steve Rubell in 1978.

It was a serious crime deserving punishment. But Schrager has lived an exemplary life ever since. His hotel and real-estate contributions made him a prince of the city. He lives at 40 Bond St. in an architecturally distinguished building developed by his own Ian Schrager Company.

The opening next year of a 370-room Public Hotel on a once-nowhere block on Chrystie Street might be his crowning achievement. He’s also a partner and “creative director” in the Times Square Edition by Marriott Hotel set to open by year’s end.

That squeaky-clean Marriott — a publicly traded company still run by Marriott family members — chose to team up with Schrager speaks volumes about his character.

What makes Schrager’s case special is his longstanding contrition. Unlike most white-collar criminals, he never whined, as many have done, “They wanted to make an example out of me.”

He blamed only himself. He told The Post this week, “It was a terrible thing that I did. It weighed on me, and it was a terrible embarrassment to me and my family, my kids.”

Note the language: the “terrible thing” was his violation of the law, not the conviction that cost him his civil liberties, including his right to vote.

Schrager deserved accolades for Studio 54 despite his tax scam and for the disco’s many unsavory aspects.

It was notorious for rampant drug use — a giant coke spoon suspended from the ceiling drew nightly cheers — and for not-always-furtive sex in its myriad nooks and crannies.

Even so, the West 54th Street party palace kick-started New York’s dormant pulse at a desperate time. Johnny Carson had moved “The Tonight Show” to Los Angeles, and many citizens rich, poor and in-between, were also looking to flee.

But Studio 54’s nightly, life-affirming parade of boldfacers — from Halston to Liza Minnelli and even to classical pianist Vladimir Horowitz — declared that the crime- and decay-ridden metropolis could still be a magnet to the world’s most talented artists and strivers.

Schrager’s best known today as the inventor of sexy “boutique” hotels — which he first created at Morgans, the Royalton and the Hudson. They weren’t ground-up new buildings, but ingenious remodelings and “repositionings” of fading old ones.

He and designer Philippe Starck brought to the once-gloomy inns a sexy, slightly spooky vibe with more than a hint of Studio 54’s mystery — but none of the sleaze.

Their success reflected native New Yorker Schrager’s faith in the city’s unparalleled regenerative powers.

“It’s still the capital of the planet,” he said this week — despite innumerable forecasts of its demise.

Over lunch at Balthazar about 10 years ago, when he was partners with real-estate developer Aby Rosen, Schrager excitedly told me of a plan they had for a complex of new buildings on Tenth Avenue near West 20th Street. “It will be the new Rockefeller Center,” he promised.

I thought: Really? On a lumber yard site next to a crumbling old rail trestle? But although the project never got off the ground, Schrager was on to something.

Years before the High Line Park opened, he saw its potential to catalyze the creation of a whole new residential and commercial neighborhood where few then dared to tread.

A “prince of the city” isn’t always a prince. Schrager wheels and deals with partners and rivals. He’s been involved in plenty of lawsuits — par for the course in the high-stakes rough-and-tumble of Manhattan real estate.

Known as a details-obsessed control freak, he can at times sound like Donald Trump at Trump’s most bombastic. Schrager told The Wall Street Journal’s Andrew Goldman of his former partnership in the Gramercy Park Hotel with Aby Rosen, “It’s for sale again now. It didn’t do well since I sold it. It didn’t achieve its potential. Aby is a real-estate guy. He’s not a hotel operator.”

But Schrager’s more than earned his pardon. A character in a great old Sam Peckinpah western, “Ride the High Country,” famously declared, “All I want is to enter my house justified.” After 37 years, Ian Schrager can finally live justified in the greatest house of all — New York City.