Tolstoy was from the beginning of his career a moralist addressing all the questions of greed, murder, lust, vanity, love, and family as he perceived their relevance to 19th century Russia but, after the late 1870s, his beliefs and focus changed. You might think of the periods of his life divided by his "watershed" moment of his late 1870s spiritual and moral crisis as his Family Existence period followed by his Anti-Family Existence period.
Tolstoy was adamant in his belief that a happy family existence is the bedrock of life and thus represents superior values to those of social rites. Anna Karenin (1873-76 serially), War and Peace (1865-69 serially), and "Family Happiness" (1859) all depict this thematic idea in one way or another, ascribing family love above all else.
When he and his wife began quarreling so bitterly about the income and royalties from his work, he was forced by the reality of his situation to reevaluate his belief, which led him to the conclusions expressed in "The Kreutzer Sonata" (1889 ,although sometimes attributed to 1890 or even 1891) that contend that marriage is a dishonorable social institution meant only for the gratification of lust, implying (problematically) that celibacy is the only honorable state.
Another of his favorite moral themes was the superiority of the Russian peasantry's morals over those of established society, encompassing tradespeople, gentility, nobility, and the ruling classes. Two short stories that Tolstoy wrote after his moral and spiritual crisis in the late 1870s illustrate his conviction of the superior moral value of peasants over the socially elevated. "How Much Land Does a Man Need" (1886) illustrates the ruination of greed and compares it to the reasoned generosity of the peasants. "Master and Man" (1895), a much gentler tale comparing moral values, illustrates what happens when the greedy, though not cruel, master adopts the servants value of loving sacrifice.
Tolstoy also tackled the 19th century Russian ideology of death and dying in both"The Death of Ivan Ilyich" (1886) and "Master and Man" (1895). In the former, Tolstoy illustrates that vanity and greed lead to torment in the face of impending death, then presents a higher moral selflessness, represented by the little boy who is symbolic of the simple moral values of the peasants, as the answer to attaining a peaceful death. In "Master and Man," after Tolstoy's critical change of beliefs, he shows that death is to be approached by abandoning all and living on the moral--and physical--level of the morally superior peasants. In this story the Master wholly incorporates the servant's role of unquestioning selfless service, which represents the moral level, while the giving of his coat symbolically represents adopting the peasant ways on the physical level.
This is something Tolstoy himself did: He abandoned his estate, where his wife and family continued living, and lived as a peasant in a remote corner of his estate. His life ended in a dramatically painful irony. When he was eighty-two he chose to completely abandon his estate and go elsewhere to live fully immersed in a peasant life. He didn't survive the train trip and died in comfort at the station master's house surrounded by dignitaries and other representatives of the higher social levels.