"It is for all of that that we must apologise."
The apology coincides with a law change to allow men with convictions to apply for a pardon or for families to apply on their behalf. The first reading of that bill was also passed unanimously.
Robertson urged the families of those convicted men who had since died to seek a pardon on their behalf.
"It is important you take the opportunity afforded by this legislation to give dignity in death to your relatives that this Parliament did not allow them in life."
And he paid tribute to the bravery and courage of all homosexual men who lived through the times before the crime of homosexual acts was removed, and campaigned for change - including those who signed a letter in the NZ Herald in 1986, putting their name to the cause and public scrutiny, putting at risk their lives and careers.
"I respect you, I honour you and I stand on your shoulders today."
He said he and his partner Alf would soon mark 20 years of being together and 10 years of a civil union - "all things that would have been unimaginable to you, but yet which are your legacy."
Adams said it was a historic day for New Zealand and the gay community and recognised the effect the convictions had had on the lives and families of those convicted.
"It is never too late to apologise."
She said while the injustice could not ever be erased, the apology was a symbolic act to right the wrong, the right to be free from discrimination.
Green MP Marama Davidson spoke emotionally about the impact suicides from discrimination had had on her and her family.
"We lost two men to homophobia."
National MP Chris Bishop said it was effectively an apology for criminalising love and an essential step.
He had initially struggled with the issue of expunging the convictions, because of both technical and historic reasons, saying it was the law of the time.
"It's difficult to grasp that history should be revised. I struggle with that as a concept. But the thing that got me was the people who turned up at our committee and gave heartbreaking evidence about the ongoing anger, pain, shame and suffering they and their families endured.
"What was in place prior to 1997 was wrong, immoral, it was inhumane and Parliament says sorry to you."
Maori Party MP Marama Fox said it was a special day, a day to do something right.
"When we alleviate the stigma, we alleviate the pain and hurt. We can't make up for the years that have been lost to this point, but we can help carry the burden and send a message to the young people of today: you don't have to hide, you can stand proud."
Both Labour MP Louisa Wall and Jan Logie acknowledged former Green MP Kevin Hague, who had tabled the petition which led to the apology.
Logie said Hague was one of those who put his own life at risk to campaign for homosexuality to be decriminalised, living as an openly gay man in the 1980s.
Logie said the Justice and Electoral Select Committee had heard from many affected by the convictions - and of suicides.
"We heard from those whose lives were made small when they could have been huge, because of these convictions ... the shame does not lie with you, it lies with Parliament and society."
The legislation is expected to result in pardons for about 200 of the 1000 men convicted of indecency between males, sodomy, or keeping places of resort for homosexual before law reform in 1986.
There is no blanket pardon - some will be ineligible to have their records wiped if it involved non-consensual or underage sex, or other activities that would be illegal today.
NZ First MP Denis O'Rourke said the party fully supported the apology and the bill to pardon those convicted for consensual acts.
He said the law those convictions were based on were "evil" and an "utter disgrace".
"They were a fundamental and extreme breach of human rights. The apology is very well-deserved and grossly overdue."
Rawa Karetai, spokesman of the International Lesbian, Gay, Bisexual, Trans and Intersex Association, said while a blanket pardon would be better, the move was a good compromise.
"We hope this bill once it becomes an Act, helps restore justice for the wrongful convictions of homosexual men."
He said the stigma had impacted on their lives, affecting employment opportunities and earning potential as well as causing a social discomfort. He said applying for convictions to be quashed would be difficult for some.
"There are still people today talking to counsellors about their convictions. The process of applying for their convictions to be quashed is traumatic for some as they do not want to revisit what happened before 1986."
It could also be hard for some to meet the threshold required for a pardon, especially in cases where family members were representing the deceased.
There have been calls for compensation to be paid and Robertson urged some "creativity", such as a fund to support gay people today.
"Even today the shame and hurt of being different from the majority still exists."
Adams said the Government decided compensation would not be appropriate for the pardoned men.
"Compensation is something paid when someone is wrongfully convicted of an act that they didn't commit. This isn't the case here.
"This is a case where the men were convicted under the laws of the time and what we are saying is societal views have changed to the extent society no longer regards it as appropriate that those men are tainted by that conviction status."
She denied the apology without compensation was tokenistic.
"We are trying to put right a wrong the best way we can. What Parliament is going to do today is important, I hope it is meaningful for those involved. It is certainly something we take very seriously."
She said other Commonwealth countries had not offered compensation.
The bill to allow the pardons will go to Select Committee for public feedback.