The robots would never be built if the capitalist system didn't provide the incentive and rewards for innovating the products (robots) needed by society.
Capitalist system DO provide a lot of incentive to develop robots because they almost guaranteed will be sold with a profit if their cost + maintenance will be lower than workers' wages (including perks, insurance premiums, taxes etc).
Sold to whom? If robots end up making it so that no one can afford to pay for anything, then robots are not the most profitable option, is it.