It's because his planned time on Earth was over.. As I discuss in this answer, at the end of Rama's life Yama god of death came to Ayodhya and conveyed a message of from the god Brahma. The message is given in this chapter of the Uttara Kanda of the Ramayana:
O hero, I am thy son. Thou didst, in thy pristine birth, beget me on Maya I am Kala, the destroyer of all. Lord Brahma, the father of all creatures, has said that thou didst promise to preserve the three worlds. Formerly when having slain all animals by thy Maya thou wert asleep in the waters of the mighty deep I was born. Thereafter thou didst create the huge bodied Ananta, living in the waters as the king of Nagas. Then thou didst create two highly powerful Asuras named Madhu and Kaitabha. At that time the bones of those two Asuras having been scattered far and wide this earth containing many mountains was named Medini. Having procreated me in thy lotus navel, dazzling in celestial brilliance thou didst employ me in the work of generation. I took the charge and procreated men; but finding no other means to preserve them I worshipped thee, the lord of the universe and said O lord, thou shouldst protect the creatures, for thou art my father and giver of energy and therefore irrepressible. Thereupon for concerting means for the preservation of creatures, thou didst renounce thy irrepressible shape and assume Vishnu form. And taking thy birth from Aditi's powerful son, thou wert engaged in enhancing the delight of my brothers. Thou didst use to protect the Devas whenever they were assailed by any calamity.
O lord of the universe, it is for that reason, on beholding the destruction of creatures thou wert born on earth to slay Dasagriva. And at that time thou didst promise that thou wouldst live in the land of mortals for Eleven thousand years. Thereupon thou didst assume a human form to carry out thine desire. Now that period is ripe and this is the proper time to inform thee of it. O great king, do thou wait in this land of mortals if dost thou wish to govern people for some time more. And if dost thou wish to repair to the region of immortals, do thou again lord over the Devas in thy Vishnu form and let them be freed from anxiety.
So he defeated Ravana and ruled for 11000 years as he planned, no now it was his task on Earth was over.