Moral relativism applies to literature and art because there is no universal framework in which we can definitively measure what is good or bad, or what is right or wrong. Commonly accepted moral truths often differ by religious, societal, or cultural upbringing, and there’s even infighting within these groups as to what those commonly accepted moral truths should be (for example, American society is extremely polarized by the question of whether or not abortion is murder). Therefore, it is virtually impossible for an author to write a piece of literature that is completely ‘moral,’ because it’s impossible to create a piece of art that subscribes to the belief systems of every single person who consumes it. Because writing a universally moral book is impossible, there is no obligation or need for an author to write a moralizing narrative.
In addition, literature can be interpreted in multiple ways by multiple different readers, and even if you write a novel with the intention of making it moralizing, it might not be interpreted the way you intended it to be. For example, Joseph Condrad’s novel, "Heart of Darkness," has been widely criticized by scholars as being a colonialist text laden with racism and bigotry. In 1975, “the distinguished Nigerian novelist and essayist Chinua Achebe assailed Heart of Darkness as racist and called for its elimination from the canon of Western classicism,” famously calling Conrad a “bloody racist.” Achebe’s concern was also later raised by Edward Said, a renowned scholar of postcolonial studies. “These writers pointed to Conrad's imperialist tendencies, his apparent inability to see Africans as equal to Europeans and his use of the n-word.” Conrad, through the eyes of his narrator, “repeats ad nauseam that the African jungle is just a big, blank, philosophically significant darkness — despite the fact that millions of people make their homes there. It's arguably the most racist thing about the book."
In defense of Conrad’s word-choice, it can be claimed that “It's easy to go through 'Heart of Darkness' and find descriptions of Africans that seem to mirror rather than repudiate Victorian racism. And what else do you expect? What kind of fiction, in the early 1900s, would Conrad's critics wish him to have written?” Conrad’s language is not considered moral today, but it was at the time the novel was written, and although the novel can be interpreted as being sympathetic to the imperialist vision, it can also be argued that the novel is actually a criticism of European imperialism, meant to highlight how the Belgian invaders are the true “savages”- “Who has ever read Heart of Darkness and missed its massive, central expression of disgust at the white man's ‘Enterprise’?” This is an example of it being impossible to create a work of literature that is universally moral because the intended message of the novel is not always how it will be received by the wider audience.