Jai Sri Ram.
Rama enlightens Dharma to Vali :
Vali is guilty of deviating from both Raja-dharma as well as Vanara-dharma.
1. Raja-dharma requires a King to protect/save the one who seeks pardon/surrenders at his feet. Vali not only failed to treat his brother, Sugreeva, as his own son but also chased him to the brink of death ignoring the axiom ''praNaan pari thejya harihi rakshitouya:"
2. Nara or Vanara- in both the dharma brother's wife has to be counted as his own daughter-in-law but Vali made Sugreeva's wife, Ruma his wife. An exception perhaps for Vanara is that widow of a deceased brother can be given asylum while humans have no such exceptions. Vali contrary to such Vanara-dharama usurped Ruma, when Sugreeva is alive and forced in-exile.
3. Ravana, the anti-hero, by separating Seetha from Rama, has become His enemy. Vali having friendship with Ravana, an enemy's friend is an enemy for Rama too. This apart working with Vali to trace Seetha''s where abouts, will amount to taking side with adharma for the said reasons. Hence Vali's suggestion to Rama that He ought to have sought his friendship is un-tenable.
4. A King will be sinned if the guilty is not punished by him and the guilty will not be divested of his blemish either, by not undergoing the punishment. Applying this logic also Vali is punishable for Rama to escape the sin of in action.
5. Last but not the least and the under lining Deva-rahasya, by which all the Celestial who took birth in Kishkindha as Monkey-army, under the leadership of Vali, the son of Indra, instead of joining hand with Rama has become Ravana's friend and so Rama had to finish Vali before eliminating Ravana, fulfilling the promise given to Devas & DhandakaraNya Rishis.
Enlightened thus by Rama, Vali gets to know his folly and appeals to Rama that it will be apt for Him to show the same kind of bond towards Sugreeva, which He has for Bharata and Lakshmana and the same compassion towards Angada, his son. Further that Sugreeva may not insult the self-admonishing Tara, after his death. Seeking His pardon for all the blame he made against Rama, Vali breathed his last and attained veera-Swarga, the world for the valorous-vanquished.
The sinned land in naraga after death and the holy in swarga by virtue of their pApa or PuNya and those who raise above both reach the World of no-return more appropriately known as Paramapadam or Sri Vaikundam.
Lust for woman of another is a vice due to which both Vali and Ravana met their fate in the hands of a man who stood for the virtue, namely - fidelity of husband to wife. One who can not practise can not sit in judgement over the erred. Rama practised what he preached in His next Avatar as Sri Krishna, in that Magnum Opus called Bagavath Gita.
Rama followed what ever taught in ''Gitopanishad'' but the ''Love for God'', which He can only receive and not give, is exemplified by Hanuman, the other name for ''Rama Bhakti'', complementing that which is missing in Rama and for all of us to eschew such values in life.