The American Federation of Teachers, a union representing more than 1.8 million educators, had sued to keep members of Mr. Musk’s government efficiency team out of the Education Department’s systems.
A federal judge prohibited DOGE from accessing private data maintained by the Education Department and OPM, reasoning that such access violates federal law.
The Trump administration canceled $900 million in contracts overseen by the Institute of Education Sciences, which partners with scientists and education companies to compile and make public data about schools each year.
Musk’s unusual demand has faced resistance from several key US agencies led by the president’s loyalists — including the FBI, State Department, Homeland Security and the Pentagon — which instructed their employees over the weekend not to comply.