I was thinking that if you wanted to train an AI to find ways to make people better off rather than maximise profits then you could.
Then I thought about it bit more.
The AI would be looking for optimal ways to persuade people to change their habits and lifestyles to make them healthier and more productive.
A little later we have the Matrix.