I'm afraid that this might sound flippant, but the answer to your question comes through another question - why were early 19th century industrialists obsessed with replacing textile workers? Replacing workers with machines is not a new phenomenon and we have gone through countless waves of social upheaval as a result of it. The debate we're currently having about AI has been rehearsed many, many times and there are few truly novel points being made.
If you want to understand our current moment, I would urge you to study that history.
We could produce more cloth in safer working conditions.
Programers are going to be replaced by AI in the same way accountants got replaced by VisiCalc and engineers by CAD and mathematicians by calculators and software like Mathematica