I agree with the spirit of your post.
The issue arises, I think, if we forget that #capitalism is an _economic_ system. And a _political_ system, at most. _Not_ an ethical framework.
Capitalism may assign a rough “value” to individual human beings based on their economic output, but that's a byproduct of its calculations, and we should not equate that with “dignity” or “moral worth”.
It's like blaming the metric system for the fact that some people are very short. Or linguistics for the fact that some people have a different mother tongue and thus we can't communicate as easily with them.
Capitalism is fine within its sphere. As long as we make sure we use a different tool to measure moral weight, we'll be OK.