If convicted killer Gregory Thomas was hoping to have a romantic reunion with his multiple “wives,” he can forget it.

A Commonwealth Court dashed his hopes in a ruling issued Friday.

In an opinion by Judge P. Kevin Brobson, the court rejected Thomas’ argument that the state Department of Corrections’ total ban on conjugal visits for inmates doesn’t violate Thomas’ constitutional rights.

This is a battle that Thomas, who since 1990 has been serving a life sentence for a murder in Philadelphia, has been waging for years. Commonwealth Court gave him a glimmer of hope in 2014 when it refused to dismiss his case at first blush and allowed him more time to argue it out.

Ultimately, however, the court decided safety concerns outweigh the needs of Thomas, or any other state prisoner, for sex with a spouse or significant other.

Thomas, now 60, claims he has a right and a sexual and religious need as a Muslim to have conjugal relations with the women he claims are his wives. Corrections officials countered that they aren’t sure Thomas is legally married to anyone.

Brobson backed the department’s contention that denying conjugal visits is necessary to maintain security in its prisons, especially since one of the participants in the visit would be a known criminal, and often a violent one.

Barring such trysts also thwarts the spread of disease, corrections officials contended, and reduces the ability of outsiders to pass contraband to inmates. Crowding in the prisons also leaves little space for inmates and their significant others to get it on, prison administrators said.

In Thomas’ case, they added, allowing conjugal visits would allow him to commit the crime of bigamy, provided he could prove he really is married to several women simultaneously.

“DOC cannot abate crime and ensure the health and safety of inmates by permitting conjugal visits, even in a restricted manner,” Brobson wrote. “Any conceivable restriction, due to the inherent private nature of a conjugal visit, would still result in health and safety concerns.”

Thomas had no luck on one of his other complaints, either. Brobson rejected his contention that he should be allowed to possess prayer oil. Thomas claims he needs to use the oil for each of his five daily prayers.

Under prison policy, staffers put small amounts of oil on Muslim inmates who attend Jumu’ah. Prisoners aren’t allowed to possess any oil because it is flammable and can be used to mask the scent of illegal drugs, jail officials contend.

“Due to the fact that prayer oil is available for his use, Thomas has not suffered a substantial burden on the exercise of his religion,” Brobson concluded.

Commonwealth Court did give Thomas a chance to further hash out another of his complaints, however. That is his contention that the prison phone policy is “over-reaching.”

The policy prohibits a phone number from appearing on more than one inmate’s list of permitted phone contacts. Corrections officials claim that prevents inmates from coordinating crimes by contacting mutual friends. Thomas claims the restrictions violate his right to free speech.

Brobson found the arguments on that must be addressed further before his court can issue a ruling.