My understanding is that the only reason these jobs aren't automated already is because labor is cheaper. Unfortunately I think the alternative to a terrible job like working for Foxconn is no job at all for a lot of folks.
Another alternative is USA companies paying closer to USA minimum wage. If that means more automation instead, that's fine (more efficient production), and the unemployed can use their additional free time to fight their supposedly socialist government to share the wealth.
There's probably some stickiness and deception in exploitative workplaces. From the outside they may seem better ("Make $X per hour! Guaranteed hours!"), but once you quit your existing job, move away from home, and work at the factory long enough to realize you were happier before, you may have lost the opportunity to go back to your old life -- your job may be gone, the cost of moving may be too high, you may not be able to take the reputation hit for returning home a failure.
But yeah, you are correct. There are many shitty, hazardous, dangerous, health-destroying, depressing jobs paying next to nothing out there, where it is a rational decision for many people to work there, their best option. And if the companies involved had to make the jobs not suck, they'd probably be better off automating away most of the jobs. Or more realistically, moving to a country which was willing to let the shitty jobs persist, because hey, jobs.
But "better than subsistence farming" shouldn't be the bar we're trying to clear in the 21st century.
Why should we have to choose between low paid, dangerous, uninteresting/soul destroying work or unemployment and poverty?
The question about automation, for me, is one of how we can more sensibly organise the necessary work so that we can each share both the labour and its products?
I dream of a world where I can make machines to save work, and know I'm not putting somebody out of a job they need to feed themselves, but reducing the workload for the whole of society, giving us more free time (or more stuff).
"I shall hunt in the morning, fish in the afternoon, and quibble on HN after Dinner" Marl Karx
And yet, if they made a cheaper iPhone, I'd probably buy it without much thought about how it was made. Oh technology, thy double-edged sword of irony.