CNN  — 

In a scathing decision, a federal judge blasted a subsidiary of the nation’s largest insurance company for focusing on the “bottom line as much or more” than patients’ health, saying the insurer illegally denied treatment to thousands of people. The judge also slammed the company’s medical directors for being “deceptive” under oath.

US Chief Magistrate Judge Joseph Spero issued his decision Tuesday against United Behavioral Health, a unit of UnitedHealthcare, saying the insurer created internal policies that effectively discriminated against those seeking mental health and substance abuse treatment.

“It is well-established that effective treatment of mental health and substance use disorders includes treatment aimed at preventing relapse or deterioration of the patient’s condition and maintaining the patient’s level of functioning. UBH Guidelines deviate from that standard,” Spero said.

Legal observers called the decision one of the most important and most thorough rulings ever issued against an insurance company, at the federal level, on mental health issues.

Patrick Kennedy, the former US representative from Rhode Island who has long championed mental health issues, called the ruling “breathtaking” in its scope. For the mental health community, he equated it to the landmark 1954 Supreme Court decision that found racial segregation in public schools unconstitutional.

“This ruling is the Brown v. Board of Education for the mental health movement,” Kennedy said. “The insurance industry is hellbent on violating the federal law, and they’re doing so with impunity. Now, we have a federal court specifically and forensically breaking down how they get around the federal law.”

The class-action suit was brought on behalf of more than 50,000 people denied coverage by United Behavioral Health, the country’s largest managed behavioral health care organization.

Spero took more than a year to issue his 106-page decision. In addition to finding federal violations, Spero ruled that United Behavioral Health violated state laws in Illinois, Connecticut, Rhode Island and Texas.

The judge blasted United Behavioral Health’s medical directors and other expert witnesses who set the company’s policies – naming each one before shredding them as not credibl