I am not sure about the reason of Ashwamedha Yajna but I have heard that when a person does a hundred Ashvamedha Yajna then he is capable for Indrasan (position of Indra). Lord Rama did an Ashwamedha Yajna. I don't know how many Aswamedha Yajna he did. I want to know the reason behind Ashwamedha Yajna which was done by Lord Rama.
1 Answer
The reason for why Lord Rama performed an Ashwamedha Yajna can be found in Valmiki Ramayana-UTTARA KANDA-Saraga 96 to Sarga 104 (or Saraga 83 to 91 after removing interpolated Sarga). Few shlokas and/or English translation is given below to answer this question.
Lord Shri Rama actually wanted to perform a Rajasuya Yajna:
Beholding Bharata and Lakshmana present, Rama embraced them and said "I have, as promised, performed the work of the excellent twice born one. I wish now to perform a Rajasuya sacrifice. (English Translation Source)
Why Lord Shri Rama wanted to perform a Rajasuya Yajna:
Rajasuya sacrifice, the source of religious glory, the destroyer of all sins, inexhaustible and un ending. Therefore, with you like my own self, I wish to engage in the most excellent and eternal Rajasuya sacrifice. O slayer of foes, by celebrating Rajasuya, Mitra attained to the dignity of Varuna. And having celebrated the same sacrifice, Soma, conversant with piety, established eternal fame in the three worlds. (English Translation Source)
Bharata advised not to perform the Rajasuya Yajna:
Lord Rama asked Bharata and Lakshmana about their opinion on this matter and asked what was auspicious and productive of well being in the long run. Hearing the words of Raghava, Bharata, well skilled in the art of speech, with folded hands, said
"O pious Sir in thee are established piety, earth and fame. In such a sacrifice all the royal families meet with ruin. All those kings, who are proud of manliness, being incensed with great fire on the occasion of this sacrifice, shall bing ruin upon all. O foremost of men, the whole earth has been brought under thy subjection so it is not proper to devastate it."
Hearing those sweet accents of Bharata, Rama, having truth for his prowess, attained to incomparable delight, and addressed the enhancer of Kaikeyi s delight with kind words saying:
"O thou freed from sins, I have been greatly delighted with thee. O foremost of men, for the preservation of earth,thou hast given vent to words, without any hesitation, pregnant with manliness and piety. O thou conversant with piety, according to thy wise counsels, I refrain from celebrating this Rajasuya sacrifice."
Lakshmana coined the idea of Asvamedha:
After the conversation between Rama and Bharata had been over, Lakshmana, with reasonable words, said to the former
"O worshipful Sir, amongst sacrifices Asvamedha is the best and the remover of all sins ;it is my prayer therefore that thy desire might be turned towards this great and highly puifying sacrifice." (English Translation Source)
Now coming to your Question Why did Lord Rama perform an Ashwamedha Yajna?
Below are the reasons given by Lakshmana:
It is said in this Puranas, that Purandara, sullied by the sin consequent upon slaying a Brahmana (slaying Vritra engaged in asceticism), was again purified by celebrating a horse sacrifice. (English Translation Source)
And this seems most logical in the context to your Question because Lord Rama also slayed a Brahmana (Ravana).
Lord Shri Rama supported Lakshmana:
Hearing the words of Lakshmana and smiling, the highly effulgent descendant of Raghu, Rama, skilled in the art of speech, replied Lakshmana", O foremost of men, thou hast truly related the story of Vritra's destruction and the fruits of horse sacrifice.
Lord Rama further tells fruits of Ashwamedha Yajna from king Ila's story:
O foremost of men, such is the power of the horse sacrifice, that the king Ila, though conveted into a female, regained manhood by virtue thereof.
Finally, Lord Shri Rama consulted with Vamadeva, Javali, Kashyapa and other Brahmanas and they also supported the decision of performing Ashwamedha Yajna. Then, Lord Shri Rama set free a black horse, gifted with all marks and worthy of the sacrifice.