In this very long and elaborate epic - containing more than 480 000 words - many stories are interwoven and a multitude of teachings is given. Supposedly the Ramayana in its original version has been compiled and written somewhere between 500 and 100 BCE by the legendary sage and poet Maharishi Valmiki.
The various stories contain quite contradictory messages - depending on your understanding you can come to widely differing conclusions.
The main plot of the Ramayana, which is often cited as the complete story, follows the usual Hollywood scheme. There is a hero, Rama, and a heroine, Sita. They have to face all kinds of hardship and to defeat various evil forces. The main villain, king Ravana steals the hero's wife, Sita. Rama gathers his friends and sets out to destroy the villain's empire. He conquers the empire, kills Ravana and his allies, and is reunited with Sita. The good guys win and the bad guys are killed—a happy ending.
The reason why the whole drama is initialized by the gods is revealed to Valmiki in the beginning of the story:
At one time all the gods went together to appeal to the Supreme God Vishnu, who is the preserver amongst the three major gods of the Hindu trinity, for his help. They explained, “The ten-headed Ravana and his brothers have acquired from us extraordinary powers through austerities and prayers, and now threaten to destroy our worlds and enslave us. They go along recklessly in their career of tyranny, suppressing all virtue and goodness wherever found. Shiva is unable to help; Brahma the Creator can do very little, since the powers that Ravana and his brothers are now misusing were originally conferred by these two gods, and cannot be withdrawn by them. You alone are the Protector and should save us.” Whereupon Vishnu promised, “Ravana can be destroyed only by a human being since he never asked for protection from a human being. I shall incarnate as Dasaratha’s son, and my conch and my wheel, which I hold in each hand for certain purposes, and my couch, namely Adisesha, the Serpent, on whose coils I rest, shall be born as my brothers, and all the gods here shall take birth in the world below in a monkey clan—since Ravana has been cursed in earlier times to expect his destruction only from a monkey.”
However, in the Bhagavata Purana, another important ancient Hindu scripture, we learn that the divine intervention as described in the Ramayana is part of a larger divine plan. Vishnu has promised his devoted gatekeeper Jay instant liberation after three lifetimes in human form, if he agrees to play Vishnu’s fierce opponent in all three incarnations. The form of Ravana is the second incarnation of those three. During the events of the Ramayana this initial agreement naturally has to be forgotten by the key players and is kept in the dark for everybody else involved. If the other protagonists had found out that Rama and Ravana are just playacting, the original divine intention would be lost.
Lakshman, Ram, Sita and Hanuman (kneeling), the main protagonists of the Ramayana
Furthermore the story of the Ramayana has also been included in Jain mythology, where the three key players Rama, Lakshman (Rama’s brother) and Ravana are seen as Shalaka Purushas, “illustrious or worthy persons” who are influencing the human evolution, but only if they act as an archetypical triad of gentle hero, warrior hero and anti-hero. Even though the anti-hero is revered a little less than the other two, all three types are worshipped and seen as important and interdependent roles in the unfolding of events.
So actually we have very contradictory messages in the Ramayana depending on the version you're looking at. If you only look at the core story, the conclusions are quite simple: Do as Rama does and do NOT do as Ravana does. For billions of Hindus this has been a valuable and practical guideline in life, and the values of the Ramayana have been the foundation for every Hindu society around the planet. There is nothing wrong with that! There have been much fewer fights within the Hindu communities than within Muslim or Christian groups throughout the centuries. Those people, who are happy to live a life within the samsaric cycle (continuous cycle of life and death) will fare better in their lives if they follow the behavioral blueprints, which Rama, Sita and the other good characters in the story are embodying.
Rama kills Ravana in the final battle
If, however, you happen to be one of the few that are willing to see the bigger story, the whole value system falls apart and becomes irrelevant. For the seeker of liberation from the cycle of life and death, the normal moral code is not binding. Ravana is eager to fulfil his promise to Vishnu, even though he doesn't remember the real reason, and in spite of his advisors and friends urging him to give in to Rama. He is often more convincing in the way he plays his role until the very end than Rama and his brother Lakshman, who are committing a lot of blunders and succeed in the end only with the help of their divine companion Hanuman.
In other words: for those, who desire a smooth life within society and in the worldly realms, it is advisable to follow certain legal or ethical codes and rules to avoid trouble and to be appreciated by your fellow humans. The advantage is that these rules and laws protect you from the violation of your rights by others and you can complain to the authorities of your society if your fellow human beings harm you or break the rules and laws, and most of all - you may get reborn on a higher plane. The disadvantage is that you will either have to compromise or accept punishment if you yourself are caught breaking the rules.
But for those, who seek liberation, it’s a whole different story. You might be chosen to be a villain in a divine drama and that may just be your path to awakening.
A beautiful modern film version by American artist Nina Paley: