The author has commented that he regrets having overlooked the moral implications of simulated life in his previous works (see e.g. http://gregegan.customer.netspace.net.au/PERMUTATION/FAQ/FAQ..., which contains spoilers for Permutation City) so I wouldn't be surprised if that was the inspiration for this story.
https://www.amazon.com/Cyberiad-Stanislaw-Lem/dp/0156027593
It touches thoughtfully and humorously on: AI, simulations, robotics, ethical and moral questions regarding artificial life, among many other interesting topics. It's one of the funniest and greatest science fiction books I've ever read.
I mean, plenty of people don't take issue with a lot of things I find reprehensible.
Are you morally prohibited from turning them off?
Can you reset to a save point, possibly undoing the creation of some of the sentient beings?