Srimad Bhagavatam Canto 05, Chapter 19, Text 05

SB 5.19.5

martyavataras tv iha martya-siksanam
 rakso-vadhayaiva na kevalam vibhoh
kuto ’nyatha syad ramatah sva atmanah
 sita-krtani vyasananisvarasya
Translation by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
It was ordained that Ravana, chief of the Raksasas, could not be killed by anyone but a man, and for this reason Lord Ramacandra, the Supreme Personality of Godhead, appeared in the form of a human being. Lord Ramacandra’s mission, however, was not only to kill Ravana but also to teach mortal beings that material happiness centered around sex life or centered around one’s wife is the cause of many miseries. He is the self-sufficient Supreme Personality of Godhead, and nothing is lamentable for Him. Therefore why else could He be subjected to tribulations by the kidnapping of mother Sita?
Purport by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
When the Lord appears in this universe in the form of a human being, He has two purposes, as stated in Bhagavad-gita — paritranaya sadhunam vinasaya ca duskrtam: to destroy the demons and protect the devotees. To protect the devotees, the Lord not only satisfies them by His personal presence but also teaches them so that they will not fall down from devotional service. By His personal example, Lord Ramacandra taught the devotees that it is better not to enter married life, which is certainly followed by many tribulations. As confirmed in Srimad-Bhagavatam (7.9.45):
yan maithunadi-grhamedhi-sukham hi tuccham
 kanduyanena karayor iva duhkha-duhkham
trpyanti neha krpana bahu-duhkha-bhajah
 kandutivan manasijam visaheta-dhirah
Krpanas, those who are not advanced in spiritual knowledge and who are therefore just the opposite of brahmanas, generally take to family life, which is a concession for sex. Thus they enjoy sex again and again, although that sex is followed by many tribulations. This is a warning to devotees. To teach this lesson to devotees and to human society in general, Lord Sri Ramacandra, although the Supreme Personality of Godhead Himself, underwent a series of tribulations because He accepted a wife, mother Sita. Lord Ramacandra underwent these austerities, of course, only to instruct us; actually He never has any reason to lament for anything.
Another aspect of the Lord’s instructions is that one who accepts a wife must be a faithful husband and give her full protection. Human society is divided into two classes of men — those who strictly follow the religious principles and those who are devotees. By His personal example, Lord Ramacandra wanted to instruct both of them how to fully adopt the discipline of the religious system and how to be a beloved and dutiful husband. Otherwise He had no reason to undergo apparent tribulations. One who strictly follows religious principles must not neglect to provide all facilities for the complete protection of his wife. There may be some suffering because of this, but one must nevertheless endure it. That is the duty of a faithful husband. By His personal example, Lord Ramacandra demonstrated this duty. Lord Ramacandra could have produced hundreds and thousands of Sitas from His pleasure energy, but just to show the duty of a faithful husband, He not only rescued Sita from the hands of Ravana but also killed Ravana and all the members of his family.
Another aspect of the teachings of Lord Ramacandra is that although Lord Visnu, the Supreme Personality of Godhead, and His devotees may apparently suffer from material tribulations, they have nothing to do with such tribulations. They are mukta-purusas, liberated persons, under all circumstances. It is therefore said in the Caitanya-bhagavata:
yata dekha vaisnavera vyavahara duhkha
 niscaya janiha taha paramananda-sukha
A Vaisnava is always firmly situated in transcendental bliss because of engagement in devotional service. Although he may appear to suffer material pains, his position is called transcendental bliss in separation (viraha). The emotions a lover and beloved feel when separated from one another are actually very blissful, although apparently painful. Therefore the separation of Lord Ramacandra from Sitadevi, as well as the consequent tribulation they suffered, is but another display of transcendental bliss. That is the opinion of Srila Visvanatha Cakravarti Thakura.
Srimad Bhagavatam Canto 05, Chapter 19, Text 04
Srimad Bhagavatam Canto 05, Chapter 19, Text 06