Convicted killer and sex offender Phillip John Smith says it is discriminatory to forbid prisoners in a sex offenders' treatment unit from sleeping together.
Smith is serving a life sentence for murdering the father of a boy he was sexually abusing.
He made headlines in 2014 for a short-lived escape to Brazil while on temporary release from prison.
In 2022, he lost a High Court bid to allow sex between prisoners at the units for child sex offenders at Rolleston Prison.
Representing himself at the Court of Appeal in Wellington on Wednesday, Smith challenged the decision by Justice Gerald Nation, which found he had not proved the rule breached the Bill of Rights Act.
The decision said allowing sex would prejudice the therapeutic programmes for prisoners, and that before the ban was in place, some men "felt unable to decline sexual contact because of elements of coercion, pressure and a clear power dynamic".
On Wednesday, Smith told Justices Susan Thomas, Jillian Mallon and Edwin Wylie that as participation in the sex offender treatment programme was voluntary, so too was consenting to abstain from sexual activity.
He suggested people in a sexual relationship should be able to make that known to authorities, and seek approval, to avoid being kicked out of the programme.
The rule was also discriminatory against non-heterosexual men, he claimed - because in practice, the ban only applied to them.
"The likelihood of heterosexual men wanting to have sex with each other is fairly improbable.
"So in a practical sense, the rule actually really only applies to people that have an orientation that's not heterosexual."
The ban was "illogical" and "counterintuitive", he said, claiming the prison had not explained how the rule would help reduce child sex offending.
Punishing people for consensual sexual activity made no sense when the goal of the programme was to understand consensual sex, he said.
Crown lawyers Peter Gunn and Sofija Cvitanovich said the rule against sex was not a breach of prisoners' rights and was not discriminatory.
While there was no prohibition of sex in prison, there was no "explicit right" to it either- so the rule was not unlawful, Cvitanovich said.
The lawyers added Smith had provided no evidence of the relative impact of the rule on people of different sexual orientations - because the rule applied to everyone in the units.
"There are prisoners in the units who are not necessarily homosexual prisoners, bisexual prisoners, but prisoners who have issues in terms of violence who are looking to take advantage of other prisoners in some way," Gunn said.
"So to say that it's a heterosexual versus non-heterosexual, I think, is too simplistic."
The rule was important to keep everyone safe, and ensured there could be no misunderstanding about what was and was not allowed, he said.
The Justices' decision was reserved.