Critics of Islam often ask me, "why did Muhammad (peace be upon him) kill the innocent Jews of the tribe of Banu Qurayza?"
First, they were not innocent. After his arrival in Medina, Prophet Muhammad (peace be upon him) signed a Joint Defense Pact of Medina with the Jewish tribes. In which, they agreed to fight together against any army that attacks Medina and not to assist the enemy against one another. Soon after the Jewish power start fading away and the power of Prophet Muhammad (peace be upon him) and the Muslims kept increasing. This made the jews jealous of them and they secretly started inviting the enemy to attack the Muslims and promised the assistance. They also made attempts to murder the Prophet Muhammad (peace be upon him). Subsequently two these tribes, Banu Nadir and Banu Qaynuqa broke their treaties with the Muslims. They eventually had to surrender, when the Muslims besieged them. The Prophet showed mercy upon them and spared their lives. These two tribes were exiled from Medina.
Only the Jewish tribe of Banu Qurayza was left behind in Medina. When the pagans of Mecca with their confederates besieged Medina and the battle of the trench, Banu Qurayza broke their treaty with the Muslims and started preparations to attack the Muslims. When the Prophet came to know about it he sent Saad bin Muadh (may Allah be pleased with him) to remind Banu Qurayza of their treaty. Since Saad bin Muadh (may Allah be pleased with him) was the chief of Banu Qurayza's confederate, the Aws tribe. Saad bin Muadh (may Allah be pleased with him) tried to persuade the chief of Banu Qurayza not to break his treaty with the Muslims, but he wouldn't listen. One night a strong wind forced the padgan army to flee. Allah sent the Archangel Gabriel to the Prophet, who told him to teach Banu Qurayza a lesson for their treachery during the war. The Muslims besieged be tribe of Banu Qurayza. After the siege of almost a month, Banu Qurayza surrendered only on the condition that Saad bin Muadh (may Allah be pleased with him) would be allowed to judge concerning them instead of the Prophet because they didn't trust the Prophet. The Prophet Muhammad (peace be upon him) accepted the condition and allowed Saad bin Muadh (may Allah be pleased with him) to judge concerning Banu Qurayza.
Second, the verdict against Banu Qurayza had been given by their own favorite, they had chosen themselves to judge concerning them. Banu Qurayza had chosen Saad bin Muadh (may Allah be pleased with him) because he was the chief of their confederate, the tribe of Aws and he had always protected them in the past. Saad bin Muadh (may Allah be pleased with him) agreed to be the judge only on the condition that his judgment would be the final verdict and no one would challenge it including the prophet. Everyone including the prophet agreed to it. Saad bin Muadh (may Allah be pleased with him) judge them according to their own Holy law, the Torah. The Prophet Muhammad (peace be upon him) could not challenge it as he had already promised.
Banu Qurayza suffered that fate only due to their own treachery and utter stupidity that they did not trust the Prophet Muhammad (peace be upon him) to judge concerning them. The Prophet, of whom God says in His final revelation, “And We have no sent you, [O Muhammad], except as a mercy to the worlds.” (Al-Qur’an 21:107) Had they accepted him as the judge, Muhammad (peace be upon him) would definitely had shown mercy upon them, forgiven them and let them go alive as he had already forgiven and let go of the two previous Jewish tribes of Medina that had broken their treaties with him.
One may ask, why did Saad bin Muadh (may Allah be pleased with him) give such a harsh verdict, in fact the harshest in the lifetime of the Prophet Muhammad (peace be upon him)? The reasons for his so hard a verdict have been put together by Martin Lings as such,
"Some of his clansmen went to him, and mounting him on an ass they brought him to the camp. "Do well by thy confederates," they said to him on the way, "for the Messenger of God hath set thee in judgement upon them for no other purpose than that thou mayst treat them with indulgence." But Sa'd was a man of justice; like 'Umar he had been against sparing the prisoners at Badr, and their opinion had been confirmed by the Revelation. Many men of Quraysh who had been ransomed on that occasion had come out against them at Uhud and again at the trench; and in this last campaign the strength of the invaders had been largely due to the hostile activities of the exiled Jews of Bani Nadir, If these had been put to death instead of being allowed to go into exile, the invading army might have been halved, and Bani Qurayzah would no doubt have remained faithful to their pact with the Prophet. The arguments offered by past experience were not in favour of leniency, to say the least. Moreover, Sa'd had himself been one of the envoys to Qurayzah at the moment of crisis and had seen the ugliness of their treachery when they had thought that the defeat of the Muslims was certain. It was true that if he gave a severe judgement most of the men and women of Aws would blame him, but that consideration would not have weighed much with Sa'd at any time and now it weighed not at all, for he was convinced that he was dying."
(MUHAMMAD his life based on the earliest sources - Martin Lings, page 231)