The men brought a number of allegations against the Capital and Coast District Health Board and Waitemata District Health Board, the Attorney-General, the Mental Health Review Tribunal, and the District Inspector.
The causes of action relate to sexual abuse suffered by one patient at the hands of another; aspects of the men's care, treatment, and rehabilitation; sexual expression; restraint and seclusion; discrimination, and medical treatment and consent, among other things.
Issues around why patients weren't allowed to have sex with each other or touch one another were discussed, as well as why patients could not have access to sex workers.
References were made to other forms of physical support offered to patients, including trips to SPCA petting zoos, and access to weighted toy pets and blankets, and sensory rooms.
There was also discussion on seclusion and restraint, but Justice Rebecca Ellis said in her judgment that the evidence "overwhelmingly" showed that seclusion and restraint were only used for as long as the safety of the patient and others required it.
There was no evidence to suggest such measures had been used in a degrading or demeaning way.
Justice Ellis dismissed all the claims, many of which she could find no evidence on.
"The short and more general point is that the three applicants have, throughout their time in compulsory care, received dedicated and compassionate care from dedicated and compassionate staff," she said in her judgment.
"It is accepted that, on occasion, certain things could have been done better. But the very real, albeit slow, progress made by each of the applicants, in his own way, speaks for itself.
"So it is, I think, important to record that I remain entirely unpersuaded that any one of the staff members who has cared for these three men over the years has ever been motivated by anything other than the men's best interests.
"I have not before come across such a devoted group of medical professionals, committed to caring for and improving the lives of those such as the applicants, often under difficult and dangerous circumstances."
Both DHBs involved in the claim welcomed the judgment released today.
Dr Jeremy Skipworth, clinical director of Waitemata DHB's Mason Clinic, said the judgment highlighted the quality of the care provided and the compassionate approach of mental health staff to assist the men in their rehabilitation.
"The focus of inpatient treatment is always on rehabilitation and the court has recognised that this therapeutic outlook is in no way compromised when caring for patients with intellectual disabilities," he said.
"The fact that the health of one of the patients referred to in the judgment has progressed to the point that he has been able to move out of the inpatient environment and into community care clearly demonstrates the success of this approach."
Capital & Coast DHB Mental Health, Addictions and Intellectual Disability general manager Nigel Fairley echoed the judgment's comments about the dedication and compassion of the staff involved in the care of the three patients.
"Our staff are devoted and committed to caring for, and supporting, all our clients and only ever work with the client's best interests in mind."