He is asking: if the Prophets were physically perfect and protected from sin, how come Moosaa (peace be upon him) had a speech impediment and killed a soul who had done no wrong?
Question

I have read about how the Prophets (peace be upon them) were protected from physical and moral deficiencies, so how come Sayyiduna Moosaa (peace be upon him) was unable to speak clearly, and how could a Prophet kill a person who had done no wrong? Is this contrary to the idea of their infallibility (being protected from sin)?
Praise be to Allah.Firstly:
Allah, may He be glorified and exalted, honoured His Messengers and made them qualified to carry and convey the message, and He made them perfect in physical form and character, and chose them to convey the message from Him, and He placed the message with them and not with others. “Allah is most knowing of where He places His message” [al-An‘aam 6:124].
Hence Allah proved Moosaa to be innocent of what the Children of Israel said, when they annoyed him by accusing him of having a physical defect, because they used to bathe naked, looking at one another, but Moosa used to bathe on his own, concealing himself. So they said: By Allah, nothing is keeping Moosa from bathing with us except for the fact that he has a scrotal hernia. One day he went to do ghusl and he put his garment on a rock. The rock fled with his garment, and Moosa began to run after it, saying: ‘My garment, O rock!’ until the Children of Israel looked at Moosa and said: ‘By Allah, there is nothing wrong with Moosa.’ Then he took his garment and started striking the rock.”
Narrated by al-Bukhaari (278) and Muslim (339).
The word translated above as scrotal hernia refers to a swelling of the testes.
Ibn Hajar al-‘Asqallaani said, commenting on this hadith: This indicates that the Prophets, in their physical form and character, were perfect and that whoever attributes any physical defect to any one of the Prophets is saying something offensive, and there is the fear that the one who does that may become a disbeliever.
End quote from Fath al-Baari (6/438)
Secondly:
The impediment in the speech of Moosaa (peace be upon him) was not a defect that he was born with. The most well-known view is that it is a defect resulting from a hot coal that he placed in his mouth when he was a child, as some mufassireen stated.
Injuries happened to the Prophets as they may happen to other people; they might be hurt or injured, which resulted in them developing some physical defects, as happened to the Prophet (blessings and peace of Allah be upon him) when his tooth was broken in the Battle of Uhud.
But because this acquired defect would have an impact on the conveying of the message, Moosaa asked his Lord to remove the impediment from his speech:
“[Moses] said, ‘My Lord, fill my heart with courage and steadfastness
And ease for me my task
And untie the knot from my tongue
That they may understand my speech’”
[Taa-Haa 20:25-28].
And Allah, may He be exalted, answered his prayer: “[Allah] said, ‘You have been granted your request, O Moses’” [Taa-Haa 20:36].
Ibn Katheer said in his commentary on the verse in which Allah, may He be exalted, tells us that Pharaoh said (interpretation of the meaning), “Or am I [not] better than this one who is insignificant and hardly makes himself clear?” [az-Zukhruf 43:52]:
The words “and hardly makes himself clear” are another fabrication [on Pharaoh’s part], because even though something happened to his tongue when he was a child because of that coal, he asked Allah, may He be glorified and exalted, to untie the knot from his tongue so that they could understand his speech, and Allah answered that prayer, as it says in the verse (interpretation of the meaning): “[Allah] said, ‘You have been granted your request, O Moses’” [Taa-Haa 20:36].
End quote from Tafseer Ibn Katheer (7/232).
From this it is clear that what had happened to Moosaa’s tongue did not interfere with his carrying out of his mission and conveying the message in a manner that was proper and clear, and it was not a disfigurement or defect that would put people off listening to him, and it was something that would cause them to criticise him, except by way of the lies and fabrications of the accursed Pharaoh.
Secondly:
The Prophets are the elite of humanity and the dearest of humanity to Allah, may He be exalted. Allah protected them from committing major sins, so they never committed such deeds, for they were protected from them both before their missions began and after that.
Shaykh al-Islam Ibn Taymiyah said in Majmoo‘ al-Fataawa (4/319):
The view that the Prophets were infallible and protected from committing major sins, but not minor sins, is the view of the majority of Muslim scholars and of all the sects… It is also the view of most of the scholars of tafseer and hadith, and the fuqaha’. Indeed nothing was narrated from the early generations, the leading scholars, the Sahaabah and Taabi‘een and those who followed them except that which is in accordance with this view. End quote.
As for minor sins, they or some of them may have done such deeds. Hence the majority of the scholars are of the view that they were not protected from them, and if they did such deeds, their sin would not be approved of; rather Allah, may He be blessed and exalted, drew their attention to that and they hastened to repent from it.
See the answer to question no. 248875.
One example of that is Moosaa’s killing of the Egyptian; the latter was not without fault, and Moosaa did not kill him deliberately; rather it was an error, and what motivated him to do that (strike the man) was support of one who had been wronged, because the Egyptians had enslaved the Children of Israel and were mistreating them.
Al-Qurtubi said:
Rather he supported him because supporting one who has been wronged is something that is encouraged in all religions and is enjoined in all systems of law. Qataadah said: The Egyptian wanted to force the Israelite to carry firewood to the kitchen of Pharaoh’s palace, but the Israelite refused to do that, and called on Moosaa to help him.
Al-Qurtubi said in his commentary on the verse, “He said, ‘My Lord, indeed I have wronged myself, so forgive me,’ and He forgave him” [al-Qasas 28:16]:
Moosaa (peace be upon him) regretted that punch that killed a soul, and his regret prompted him to beseech his Lord and seek forgiveness for his sin.
Nevertheless, killing him was a mistake, because usually punching and kicking are not lethal.
Muslim narrated from Saalim ibn ‘Abdillah that he said: O people of Iraq, I will not hold you accountable for minor sins when I commit major sins, for I heard my father ‘Abdullah ibn ‘Umar say: I heard the Messenger of Allah (blessings and peace of Allah be upon him) say: “Fitnah (turmoil) will come from here” – and he pointed towards the east – “from where the side of the head of the Shaytaan will emerge, whilst you are striking one another’s necks. Moosaa killed the man of Pharaoh’s household by mistake. Allah, may He be glorified and exalted, says (interpretation of the meaning): “And you killed someone, but We saved you from retaliation and tried you with a [severe] trial” [Taa-Haa 20:40].
End quote from Tafseer al-Qurtubi (13/261).
Al-Qastallaani said:
No aspersions can be cast on his infallibility because of his having made a mistake. Moosa described it as being the work of the Shaytaan in one verse [al-Qasas 28:15], and said that he had wronged himself and prayed for forgiveness  [al-Qasas 28:16], as was the way of the Prophets, for they would take the matter of even minor sins very seriously.
End quote from Irshaad as-Saari (7/206).
However, even though there was a reason for striking this Egyptian, his death was a mistake, and Moosa did not deliberately kill him, it happened before Prophethood came to Moosa ( peace be upon him), and the Prophets were not protected from sin before Prophethood came to them, especially when the intention was sound and there was a reason for the action.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
I do not know that the Children of Israel criticised any of the Prophets for committing sin and repenting from it; rather they used to cast aspersions upon them by fabricating lies against them, as they used to offend Moosaa. Moosaa killed the Egyptian before Prophethood came to him, and he repented from having asked to see Allah and so on after Prophethood came to him. I do not know of any of the Children of Israel who cast aspersions upon him for such a thing.
End quote from Minhaaj as-Sunnah an-Nabawiyyah (2/409).
And Allah knows best.