The fact that the groom lives in a nursing home at the time of marriage should not affect the bride's rights. While the husband is living and in the nursing home, the wife may or may not be entitled to a share of his income based on her own income and Medicaid’s rules on spousal protection. After he dies, if she survives him she would have the same Social Security pension rights as any other surviving spouse.
Another question, however, is whether the state Medicaid agency would look to impose the asset limits for spouses of nursing home residents on the new wife. There are a lot of legal arguments why they should not, but the marriage could lead to a dispute with the state Medicaid agency. It might make sense to contact them prior to the marriage to ask how they would react.