Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A federal judge in Texas ruled Tuesday that the state can't cut off funding for Planned Parenthood over secretly recorded videos taken by anti-abortion activists in 2015, which critics said were misleading and heavily edited.

"A secretly recorded video, fake names, a grand jury indictment, congressional investigations — these are the building blocks of a best-selling novel rather than a case concerning the interplay of federal and state authority through the Medicaid program," U.S. District Judge Sam Sparks wrote in an order.

"Yet, rather than a villain plotting to take over the world, the subject of this case is the State of Texas's efforts to expel a group of health care providers from a social health care program for families and individuals with limited resources," Sparks wrote.

Planned Parenthood has repeatedly denied that they did anything wrong or illegal. Sparks made the comments in an order granting a preliminary injunction preventing the Texas Health and Human Services Commission from ending Medicaid agreements with Planned Parenthood.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Related: Abortion Clinics Report Threat of Violence on the Rise

Sparks wrote that the commission relied on "unsubstantiated and indeterminate allegations" about a "willingness" to violate ethical standards and that it had produced no evidence of any actual violation that would warrant cutting it off from the program.

The commission issued an initial notice of termination of Medicaid contracts following the release of the videos in 2015, which critics have accused of being heavily edited and misleading. It resumed its effort in late 2016.

Investigations into those videos by 13 states have concluded without criminal charges, and Planned Parenthood officials have denied any wrongdoing.

Texas Attorney General Ken Paxton, a Republican, called Sparks' ruling "disappointing" and vowed to appeal.

"No taxpayer in Texas should have to subsidize this repugnant and illegal conduct,” Paxton said in a statement. "We should never lose sight of the fact that, as long as abortion is legal in the United States, the potential for these types of horrors will continue."

Related: Planned Parenthood Video: Why Use Tissue From Aborted Fetuses?

A Houston grand jury indicted two activists behind the videos over how they covertly gained access inside a Planned Parenthood clinic, but a judge later dismissed all charges.

In announcing the judge's decision on Twitter, Planned Parenthood of Greater Texas said its "doors [are] still open to low-income Texans who count on us for healthcare."

Breaking News: Planned Parenthood doors still open to low-income Texans who count on us for healthcare. https://t.co/u7yHYXpzrB — Planned Parenthood (@PPGreaterTX) February 21, 2017

Planned Parenthood serves only a fraction of the 4.3 million people enrolled in Medicaid in Texas, but Sparks said he was not convinced that its clients would quickly and easily be able to find new providers. Sparks was nominated by President George H.W. Bush in 1991 and was confirmed by the Senate a month later.