The department largely sided with the rule’s opponents who believed that large disparities were not evidence enough of discrimination in classrooms, and could be a result of other factors such as districts’ capacity to train teachers in properly identifying and disciplining students with disabilities. It also argued that the rule could have unintended consequences for those same children if districts felt pressure to meet “racial quotas” to avoid being found in violation of the rule.

“The secretary is concerned that the regulations will create an environment where children in need of special education and related services do not receive those services because of the color of their skin,” the department wrote.

But Judge Chutkan wrote in her ruling that the department’s concern over racial quotas “did not have adequate support in the rule-making record.” She wrote that the department failed to show how the safeguards in the Obama-era rule, which expressly prohibited racial quotas, were insufficient.

She also found that the department violated the law that governs the promulgation of regulations by failing to provide a “reasoned explanation” for delaying the rule and failed to “account for the costs to children, their parents and society.”

Representative Robert C. Scott of Virginia, the chairman of the House Education and Labor Committee and a vocal critic of delaying the rule, said it was “troubling that the department delayed this critical rule without fulfilling its legal responsibility to provide a rational justification.”

“By forcing the Trump administration to implement the rule, the court’s ruling will put us back on a track toward reversing systemic racial discrimination in education,” Mr. Scott said in a statement.

But district leaders might not welcome the news. Among those who supported Ms. DeVos’s delay of the rule was the School Superintendents Association, which represents more than 13,000 superintendents across the country.