Here’s a heartwarming story out of New York.

A man who spent 17 years in prison before a court said he might be innocent in the murder of his parents is due to receive his law degree Sunday, vowing to work to exonerate wrongly convicted prisoners . . .

Tankleff was arrested in 1988 on the first day of his senior year in high school and accused of killing his parents, Seymour and Arlene Tankleff, who were brutally attacked in their home in an exclusive Long Island enclave. He initially confessed after a detective lied to him saying his injured father had identified him as the killer, but he quickly recanted. Tankleff was convicted in 1990 and sentenced to 50 years in prison.

But in December 2007, he was freed after an appellate court said key evidence in his trial had been overlooked and he was entitled to a new trial. Prosecutors opted against a second trial, citing the passage of time and changes in the law since Tankleff was arrested.

Now 42, Tankleff is married with a 17-year-old stepdaughter. He received a bachelor’s degree in sociology from Hofstra University in 2009 and graduates this weekend from Touro Law School on Long Island. As an attorney — he takes the bar exam in August — he vows to help wrongly convicted prisoners.

In September, he will become executive director of a newly formed Long Island-based organization that will do work similar to that of the better-known Innocence Project. That organization, co-founded by well-known attorney Barry Scheck, was among the groups that helped work to free Tankleff.

Scheck said in a statement that he is “tremendously proud” of Tankleff . . .

Tankleff met his future wife while speaking to students at a Long Island college about his incarceration. They married in 2010. Laurie Tankleff, 39, described him as “an amazing husband, amazing father.” She is studying criminal justice and dreams of someday working with her husband.

This year, he settled a wrongful conviction lawsuit against New York state for nearly $3.4 million.

Freeing the wrongly convicted is only half the battle. Compensating them and integrating them back into society is just as important. Currently, 21 states have no policy for compensating exonerees, and according to the Innocence Project, about a third of all exonerees aren’t compensated at all. But even in states that do offer compensation, there can be limitations. For example, some states don’t allow compensation for exonerees who contributed to their own conviction, which means that someone who was beaten or tricked into a false confession, or pressured to accept a plea bargain under the threat of decades in prison, isn’t eligible. Some states offer job training and reentry programs to convicts upon release but don’t make those programs available to exonerees. (On the bright side, this has given rise to wonderful nonprofits such as Resurrection After Exoneration, run by exonerees John Thompson and Shareef Cousin.)

Dispensation of compensation can also be problematic. In nearly all states that do compensate the wrongly convicted, the money is paid out in annual installments, not in a lump sum. When an exoneree dies, the payments stop. He can’t will the payment on to his heirs. The problems with this policy are most evident for older or sickly prisoners. Each year the state fights to keep an elderly or gravely ill inmate behind bars is a year off that person’s life for which the state will not be required to pay compensation.  Now, I doubt that prosecutors are making this calculation when deciding whether to fight a wrongful conviction claim. But the injustice here is clear: The more years an innocent person spends in jail, the less likely he is to receive the full compensation he is owed by the government.