Fairy tales, urban legends, myths and stories have been used to teach morality and ethics probably since humans were capable of abstract thought and language. Fantasy fiction is just a commercialized version of the same. To me there's little difference between finding moral lessons in the Beatitudes versus the Jedi Code, which some people do.