If this is a facility that takes MediCare, this issue should be governed by OBRA §483.12 which sets forth very specific conditions under which a skilled nursing facility may transfer and/or discharge a resident.
§483.12(a)(2) Transfer and Discharge Requirements
The facility must permit each resident to remain in the facility, and not transfer or
discharge the resident from the facility unless--
(i) The transfer or discharge is necessary for the resident’s welfare and the
resident’s needs cannot be met in the facility;
(ii) The transfer or discharge is appropriate because the resident’s health has
improved sufficiently so the resident no longer needs the services provided by
the facility;
(iii) The safety of individuals in the facility is endangered;
(iv)The health of individuals in the facility would otherwise be endangered;
(v) The resident has failed, after reasonable and appropriate notice, to pay for
(or to have paid under Medicare or Medicaid) a stay at the facility. For a
resident who becomes eligible for Medicaid after admission to a nursing facility,
the nursing facility may charge a resident only allowable charges under
Medicaid; or
(vi) The facility ceases to operate.
It's impossible to tell whether the nursing home is justified with the limited facts provided. I would suggest you contact the agency in your state that regulates nursing homes (ie, in Illinois, the Illinois Department of Public Health).