This sounds great in theory, and I fully agree, but the system of compensation and wealth distribution will need to be turned upside down for that to happen.
The value created by current and future automation will somehow need to be captured and distributed to people whose financially profitable jobs are going to be replaced with unprofitable, but socially-beneficial work, there's really no way around it. Those people will still need to be fed, housed and have access to at least basic luxuries.
Furthermore, what do we do in a future "ideal" world where robots and AI are capable of providing basic necessities to sustain every human alive? Capitalism would likely break down one way or another, with branching paths that either take us to an utopia or a nightmare dystopia.
Bottom line is, AI and automation can cause short term pain, but the upside is enormous. Successful countries will be those that can manage that transition.