The NH doesn't do anything like that. The NH takes a patient and the patient pays for the stay.
The stay isn't "free". If the patient needs the care, and can't pay, that person needs to qualify for "medicade". It's a little different from state to state, but the basic qualification is that the person have less than $2000 in an estate (as a general rule).
Once someone is admitted from a hospital into a nursing home, the social workers at the NH help do the paperwork.
If the person has more than $2000, that estate must be "paid down" to $2000 in order to qualify.
In some states, and I really don't know how many, they have a "spousal protection" clause. The state will divide the assets of the couple and isolate what is owned (in liquid assets) to the person in the NH. All of those assets must be used to relieve the debt owed to the NH until the $2000 threashold is reached. At that time, the person qualifies for Medicade and the state pays.
The rest is held by the spouse, so the spouse can continue to live in the home. There are certain restrictions, like you can only have one house, etc.
If the spouse at home dies, the home / estate then transfers to the state and they sell it to pay for the NH.
If the spouse in the NH dies, the state goes away.
Does that help?