We cannot say for sure that the Lord took avatara for any single reason. Goswami Tulsidasji also explains this:
When adharma increases, the might of adharmic asuras grows, and Devas, noble people, and cows suffer. Then the Lord takes avataras. He destroys the asuras, re-establishes the rule of Devas, restores Vedic principles, and spreads His glory across all worlds. This is generally the purpose of His avataras.
Another reason, as seen earlier, is that Bhagawan wanted to refine His guards, Jaya and Vijaya, by putting them through a series of three births:
- Hiranyakashipu and Hiranyaksha
- Ravana and Kumbakarna
- Shishupala and Dantavakra
Yet another reason for Lord Rama’s avatara was to demonstrate the strength of pativratya (the virtue of a devoted wife).
Once, an asura named Jalandhara was born from the anger of Lord Shiva. As soon as he was born, he cried loudly. Brahma took him on his lap, but the child pulled so hard at Brahma’s beard that tears started flowing from Brahma's eyes. The tears fell to the ground, and Brahma named him Jalandhara ('born of water').
Jalandhara’s wife, Vrinda, was a renowned pativrata. At that time, Vrinda and Uma were both famous for their pativratya. It was believed that no one could defeat a pativrata’s husband.
Jalandhara attacked and conquered Swarga. When Lord Shiva came to help the Devas, a fierce battle ensued. Since both Jalandhara and Lord Shiva were husbands of pativratas, they were equally strong. During the fight, Jalandhara disguised himself and went to Kailasa to spoil Uma’s pativratya. However, seeing her divine radiance, he got scared and fled.
Shiva then sought Sri Hari’s help. Sri Hari went to Vrinda, disguised as a sanyasi. Vrinda asked about her husband’s welfare on the battlefield. The sanyasi told her that Jalandhara was dead. Vrinda, confident in her pativratya, said that was impossible. The sanyasi pointed to the sky, where a group of monkeys appeared to be tearing apart Jalandhara’s body.
The sanyasi said, 'If your pativratya is true, try joining the pieces of his body together. He may come back to life.' Vrinda put the pieces together, and Sri Hari entered the body as prana, bringing it to life. However, it was all an illusion, as Jalandhara was still fighting Lord Shiva on the battlefield.
By touching the body of another man, even unknowingly, Vrinda lost her pativratya. At that moment, Lord Shiva killed Jalandhara. When Vrinda realized what had happened, she cursed Sri Hari: 'My husband will be reborn, and he will separate you from your wife.'
Jalandhara was reborn as Ravana. To uphold the dignity and glory of pativratya, Sri Hari took avatara as Lord Rama and allowed Himself to be separated from His wife. Eventually, He liberated Jalandhara in his rebirth as Ravana by killing him.
This is another legend behind the avatara of Lord Rama.