Both utopian and dystopian fantasy genres examine which direction the human society can take, for the best or the worst. They are also called speculative fiction, except that it involves magical creatures. Both sub-genres raise hope of a more humane world.
Some lessons these sub-genres teach is that technology must be used wisely; it is essential to care for others and watch each others back; and it is important to protect the Earth; we can achieve incredible feats even with restricted resources. These themes strike a welcomed chord in children.
Utopian fantasy:
The utopian fantasy explore an ideal fantastic social and political society.
Examples are the world at Hogwarts in Harry Potter and the Philosopher's Stone (1997) by J.K.Rowling.
Looking Backward (1887) by Bellamy and The Human Drift (1894) by Gillette present industrialized societies who reward their members and make progress thanks to education and deserving individuals.
Millenium Hall (1762) by Sarah Scott.
The Story of the Amulet (1906) by E. Nesbit.
Redwall (1986) by Brian Jacques shows at first a perfect society of mice who care for each other an in harmony with nature.
Dinotopian (1993) by James Gurney.
Bridge to Terabithia (1977) by Katherine Paterson.
The Cure (1999) by Sonia Levitin.
Dystopian fantasy:
The dystopian fantasy explore an utterly horrible or degraded society.
Examples are Cerulean (2012) by Anna Kyss or The Hunger Games (2008) by Suzanne Collins or
Divergent (2013) by Veronica Roth or Matched (2010) by Ally Condie or The Giver (1993) by Lois Lowry or Legend (2011) by Marie Lu.
The Last Battle (1956) (Chronicles of Narnia) by C.S.Lewis where the heroes are literally in heaven.
The Wind in the Willows (1908) by Kenneth Grahame where Toad returns to his once utopian place called Toad Hall, a place which has been made dystopian after the invasion of stoats and weasels.
In A Wrinkle in Time (1962) by Madeleine L'Engle, Meg and Charles find a planet called Camazotz where there is no sickness or suffering but where every person is alike in their disability.
Resources:
Utopian and Dystopian Writing for Children and Young Adults edited by Carrie Hintz and Elaine Ostry. 2003.