The morality play is as old as literature itself. One of my favorite Science Fiction authors is L. E. Modesitt, Jr. In his Parafaith Novels he asks the question when is OK to destroy a planet and kill billions of people to save billions of people in the rest of the universe. In his novel Gravity Dreams he asks how much freedom are we willing to give up for social stability. He takes on the issue of of social inequality in in his novel Octagonal Raven. His novel Flash addresses the issue of government and corporate corruption. And of course the his most important morality play is the Forever Hero trilogy where he looks at the pollution destroyed earth and a corrupt empire.
Of course Modesitt is not alone in writing fantasy and science fiction morality plays. Tolkein’s the Lord of the Rings trilogy is a morality play. Orson Scott Cards’s Ender series is about the morality of having young people fight the wars of old people. There are many more examples.