जय श्रीराम!
स हत्वा वालिनं वीरस्तत्पदे चिरकाङ्क्षिते ।
धातोः स्थान इवादेशं सुग्रीवं संन्यवेशयत् ॥१२.५८॥
Notes: Kālidāsa says," Śrīrāma, the valiant warrior, then killed Vālī and installed Sugrīva as the King in his place, a wish long-cherished (by the monkeys), just as in Grammar, we substitute one verb for another (using the rule अस्तेर्भूः.)"
Sugrīva had been unjustly and violently driven out by his elder brother Vālī who had also taken away his wife. Śrīrāma forged an alliance with Sugrīva and promised him that he would restore his wife and his position. As a Kṣatriya, Śrīrāma was duty-bound to protect the weak against the oppressors and destroy the evil wherever he saw it. This act of his, of killing Vālī, is to be seen in that light.
***
जय श्रीराम!