It's a shame that some posters seem to be on the 'hate the rich/managers/etc' political position, because this is actually a good question that we should think about.
Don't think about this in terms of political/social inclination, but in terms of what you are doing with your life.
For the most part in my career I have not 'displaced' anyone. I have freed talented people to do other more vaulable things within the company (that they would have already been doing except those 'necessary' things had to be done by someone).
An example from a decade ago:
my (USA) company put hand held devices into hospital doctors hands so they could code their own diagnosis/procedure (ICD/CPT) sheets.
The coders (people that used to receive those sheets, not programmers) weren't people that just keyed data into the computer - they had very specialized training so they could double check the doctor as they entered the codes into the computer.
They were trained and put in that position to be valuable because a wrong coding can result in a question from the government or insurance company asking for an explanation - which caused more effort and of course delayed payment.
They bought our product so that people (see above +some nurses) could spend more time doing more useful things. The (ICD/CPT) coders can now spend more time with any sheet that didn't look right instead of having to code x sheets/hour, and the nurses no longer had to do what the coders could now do and could spend more time caring for the patients (which increased their job satisfaction).
Was there SOMEONE that was displaced because of my(our) automation actions? Sure, there are always 'unintended consequences'.
The real question is, "Do I feel guilty for improving* patients level of care?" and I answer "No."
Besides, if I'm not adding value, it is me that's going out the door 😉
*Yes, a nurse that's happier does improve the patients LOC - ever dealt with a grumpy nurse?