The Ramayana is a very long and complex epic, in which many stories are interwoven and great teachings are given.
As an example: in the main plot, which is often told as the complete story, it's the usual Hollywood scheme. There is an evil king (Ravana), who steals the hero's wife (Sita). Rama, the main hero, gathers his friends and sets out to destroy the villain's empire, kills Ravana and is reunited with Sita. So far, so good, happy end.
However, in the prologue, which is often omitted, the gods are having a council and decide that humanity should be taught a lesson. Vishnu, one of the three major gods, decides to incarnate as Rama and act as the hero and teacher. For the role of the villain a strong guy is needed. So they pick Ravanna, who is actually a powerful demon and ardent Shiva devotee with a sincere longing for enlightenment. The gods promise him liberation in his next life, if he agrees to play the villain in his current incarnation. Ravana agrees and does his thing. During the rest of the drama this initial agreement naturally has to be kept in the dark, because, if the other participants would find out that Rama and Ravana are just playacting, they wouldn't get the teaching, which was the original divine intention.
So actually we have two totally contradictory stories depending on the version you're looking at. If you just 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 practical guideline in life, and the values of the Ramayana have been the foundation for every Hindu society around the planet.. Nothing wrong with that! There have been much less fights within the Hindu communities than within Muslim or Christian groups throughout the centuries.
If however you happen to be one of the few that are willing to see the whole story, the whole value system falls apart and becomes relative. For the seeker of liberation from the cycle of life and death there is no moral code. Ravanna is often more admirable in the way he plays his role until the 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 good life within society and the worldly realms, it is advisable to follow certain rules and ethics and you can demand that your fellow human beings follow these rules, too. If they don’t, they have to be ready to accept punishment.
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: