It's like being lectured on ethical behavior by the thing that's actively eating your lunch
As a software developer, when I automate someone's job, say of a cashier, I do not start to get paid their salary - my salary stays the same.
This is different for capital investors and shareholders. They keep the cashier's salary (not directly but ultimately). This results in an increasing concentration of wealth, creates lots of suffering and destabilises the world. That is where it is unethical.