Well...
The traditional rosy picture painted for productivity includes some effort to distribute the benefits among all parties. I think that is what has changed in recent times regarding worker productivity.
For example, if you have 10 people doing some function and you bring in automation, maybe it only requires 2 or 3 to create the same product or service as before. Those who are retained at this function and are more productive are clearly worth more now, and should see an enhanced compensation. I'm not saying they get to split 10 peoples' pay but they're worth more, may need to have and maintain higher level skills, and have more responsibility. Maybe their compensation should increase 30%, 50% or by some other non-trivial margin.
The other 7 or 8 displaced workers should now theoretically be freed up to perform some other productive tasks. Maybe not all of them are retained, but many of them could be if not all. These workers' efforts and contribution can be put into additional products and services, quality control, or other "profit enhancing" activities that either create additional cash-flow or reduce expenses. For example having staff to use to analyze how things are done overall or even to examine specific processes and tune them on an ongoing basis can reduce operating costs, thus increasing the resources available for compensation as well as corporate profit.
So I don't think we're talking workers being "given" a thing in exchange for their productivity improvements. Increased productivity can mean doing much more with the worker resources at hand. This "much more" can easily translate into "much more money" after receipts and expenses are reconciled. How can one say these workers haven't earned something more?
But what seems to be happening instead is that productivity gains are being taken almost entirely as profit. In consumer goods industries the profits may not be up because they've entered a "race for the bottom" on pricing their goods. All of the productivity gains are taken to keep profits stable in the face of ever-dropping sales pricing and not a thing is being shared with the labor force, who is asked to take cut after cut.
Worse than that, many forms of productivity enhancement are viewed as "dumbing down" the work and making worker effort less valuable. While this can indeed be true (replace a craftsman with a hand tool by a drone operating a programmed milling machine) I think the problem is that the displaced "craftsman" is not being redeployed effectively to contribute to the organization more positively. That would benefit the company much more than just giving him the option of the "dummy job" and a pay cut - or walking out the door.
I get tired of all of the ignorant grinning from people who think their job is safe where they trot out comments like "well there isn't demand for buggy whips anymore either."
If software development for example is "buggy whip making" well then all the fools running businesses are doing is trying to make buggy whips faster and cheaper. That's where productivity, offshoring, and hiring legal or illegal aliens (or just that hungry guy down the road who will gladly slit your economic throat by taking your job for cheap) for the lowest wage comes in.
So my conclusion is that the people running larger companies seem to have simply broken faith with their domestic workers on the one hand, and are woefully mismanaging their companies on the other. What we really have is a tremendous management failing to contend with.
But regarding the ethics of enhancing worker productivity through software development itself... it is a question of who (what sort of organization culture) you do this for.
Sort of like bookkeeping. How ethical is that sort of thing if you're doing it for slave traders or organized crime or something?