EDIT: I found the book and replaced the vague terms I used with the title of the story and the character's name. I also added more specific details.
I recently finished reading a book on the art of writing, called Beate Not the Poore Desk by Walter Wangerin Jr. In it, he shares a story that answers this question beautifully. This is a true story of the power of the written word and how they teach us about morality:
So in 1774, a man named Wolfgang Von Goethe wrote a book loosely based on his own life called Die Leiden des jungen Werthers, which translates to The Sorrows of Young Werther. The story talks about a man named Werther undergoing romantic hardships at every turn, falling in love only to be rejected or learn that she is married to his close friend. In the end, Werther ultimately kills himself. Now, this story happened to come out during a time in which young men and women were rejecting the optimism of their parents' generation. They strove to make themselves a generation who sought the matters of the heart. This period was known as the Sturm and Drang ("Storm and Stress") of weltschmerz ("world weariness and pain"). So they receive this book, which gives form to the feelings they inhabited, find beauty and romance in the ending, and many eventually follow the same path as the leading character.
This story is ultimately both a tragedy in itself, and the way it affected the lives of many. What does this have to do with morality? Everything. Writing is a powerful tool that can teach people what is right from wrong. And unfortunately, to those reading this book, it seemed the morally just thing to do was to escape your problems in the most painful of circumstances. Had this book ended differently, perhaps the lead accepting his love did not return his feelings and moving on, perhaps many lives would have been saved.
Every story is a morality play. Your story, whether you like it or not, should reflect what is good and just. Now that doesn't mean your characters have to be morally correct, by any means. Many stories feature flawed, even evil, characters. But themes nearly always teach morality. Do not let your story teach others lessons you don't believe in. Writing is powerful, and every piece of writing tells its audience what is good and what is not.