Calling certain cost-cutting steps inappropriate, a federal judge has ordered Kentucky’s Medicaid program to reinstate thousands it had kicked out of the program.

More than 3,500 people had been denied nursing home or home health-care services in a move to cut costs. It was wrong for the state to use cost savings as “the sole touchstone” because it then focused on an arbitrary amount of money it wanted to save rather than looking out for the medical needs or requirements of Medicaid beneficiaries, wrote U.S. District Judge Joseph Hood in his decision.

Kentucky’s Medicaid program projected it would save about $50 million with the tightening of eligibility guidelines for long-term care services. But as of January, just a fraction of that ($2 million) had been saved, partly because people continued to receive services while they appealed. New Gov. Ernie Fletcher in January relaxed eligibility rules for long-term care recipients.