If we base a person’s right to dignity, their humanity, on their capacity to suffer, prosper, reason, and choose, then a portion of the population is suddenly no longer worthy of rights or status as a human being. A person with compromised mental function has less ability to reason and choose. As do small children. Does this mean they are worth less?
Another danger is basing human worth on contribution. If a person is the sum of their contribution to society, then again we get a portion of the population that is worthless.
An elderly man who has limited ability to work, a veteran who has lost her legs, an infant who is totally dependent on his family. Are they able to work like the rest of us? Nope. Are they worthless? Nope. But why?