While concluding the law is unconstitutional, the five judge court has deferred final orders in the case to later this year after indicating there may be a legislative solution.
The court also stressed its finding does not mean prisoners have to get the full benefit of pension or other welfare payments while jailed.
The man claimed he had insufficient funds to buy items in the prison tuck shop or electrical goods and could not afford coffee, although he had a kettle.
He said he relied on clothes provided by the prison service or St Vincent de Paul, and also argued some other prisoners had access to non-State pensions.
Because this man is already sentenced, the court said that his position was complex and it would consider arguments in November over the appropriate remedy for him. It will also address costs issues later.
The relevant law is Section 249.1 of the Social Welfare Consolidation Act 2005.
Mr Justice John MacMenamin, giving the unanimous judgment, said while the State argued the law was intended to prevent “unjust enrichment” of prisoners, its true effect “can only be described as punitive, retributive, indiscriminate and disproportionate”.
The measure is an additional punishment not imposed by a court and is therefore in breach of the separation of powers and Articles 34 and 38 of the Constitution, he said.
The 76-year-old prisoner was jailed for 12 years in 2011 after he was convicted on 14 counts of rape and 60 counts of sexual assault against a family member.
When he retired in 2005, he got the State contributory pension but after his conviction in 2011, his pension payment was stopped.
He took High Court proceedings over that, seeking a declaration Section 249.1 is incompatible with the Constitution and European Convention on Human Rights and also sought damages.
After the High Court rejected his challenge, he was given permission to appeal to the Supreme Court.
The core issue was whether a prisoner has a Constitutional right to payment of the State contributory pension.