Nursing homes are a sad reflection of modern life.
Medicine has allowed people to live longer, but not necessarily healthier. This often means that the elderly today require care that a family member (usually a female, often with children still at home - thus the term the "sandwich generation") is simply not able to give. I've known several people who have had to put a loved one in a nursing home; the decision was not made easily, and did not bring any happiness. But when caring for an elderly parent begins to consume a household, there is nothing morally wrong in looking for help elsewhere.
As for the care given in nursing homes, it's true that there are good and bad examples. Unfortunately, like in many areas, money talks. Additionally, the vast majority of nursing home patients are Medicare recipients, which pays next to nothing. This means that the homes must, in turn, pay the lowest wages to healthcare personnel, which tends to attract the least professional, least attentive caregivers. It also means that many homes are woefully understaffed for the amount of patients they have.
As a nurse, I used to get nursing home patients in my hospital ward (telemetry). I would never say that the patients we got were neglected, but some were better cared for than others. The best cared for patients were the ones that had attentive staff and attentive family. Sad to say, we used to often get patients in the hospital who never had a visit or even a phone call from family, but the nursing home nurses would call and check up on them.