According to Shia view, why did Imam Ali (AS) remove Qays bin Sa'ad from the government of Egypt? Please explain in detail.
Qays bin Sa'ad bin Ibadah, head of Khazraj clan, was one of the renowned companions. He was a clever man, a skilled manager and one of the close friends of Imam Ali (A.S) fighting alongside him in many battles. Qays remained faithful to Imam Hasan after the demise of the Commander of the Faithful. He served as a deputy of Ubaidullah bin Abbas in Imam Hasan's army. Even when Ubaidullah committed treason and defected to Mu'awiyah, Qays remained with the Imam and his allegiance to Mu'awiyah was only at the behest of the Imam.
Following Uthman's death, Imam Ali (A.S) appointed him as the governor of Egypt which was then considered to be one of the strategic places in Islamic world. He was never ready to cooperate with Mu'awiyah. However, since he was an experienced and clever man serving the Commander the Faithful (AS), Mu'awiyah could not tolerate him. Therefore, Mu'awiyah forged a letter in which he had feigned to people that Qays had expressed willingness to be loyal to him. Then the false rumor spread among people and the news reached Imam Ali (A.S) and those close to him pressurized him to remove Qays from the government. Meanwhile, another incident took place which had to do with Qays bin Sa'ad. It was said that Qays had very accommodating towards the opponents because he believed that in those days of Egypt, it was better to prevent harm from the Imam. This action by Qays was not acceptable for some people. Thus, they considered it as a sign of the rumor being true. They accused him of defecting to Mu'awiyah and then they put pressure on the Imam to depose him. Eventually, despite Imam Ali (AS) being certain of Qays's action, he dismissed and replaced him with Muhammad bin Abi Bakr. However, even after this incident, Imam Ali (AS) chose him as one of his close aides and listened to his advice.
Qays bin Sa'ad bin Ibadah bin Deylam bin Haritha Ansari Khazraji, was like his father the head of Khazraj clan, and one of the renowned companions of the Holy Prophet (S). He was a clever man, a skilled manager and one of the loyal friends of Imam Ali (A.S) fighting alongside him in three battles e.g. Jamal, Siffin and Nahrawan.
In a letter directed to Qays, Imam Ali (AS) says: "Qays bin Sa'ad is one of those people whose faithfulness I am pleased with and I hope that he is eligible for what I have said and he wishes nothing but good."
Based on the reports found in historical sources, following Uthman's death, Imam Ali (A.S) appointed him as the governor of Egypt which was then considered to be one of the strategic places in Islamic world. In this designation, a conversation has been reported between him and the Imam. The conversation will help us better understand Qays's personality. Following the assassination of Uthman and the start of Imam Ali's caliphate, the Imam (A.S) called on Qays bin Sa'ad and said to him: "Go to Egypt as I have assigned you to govern Egypt. Now, go and gather all your reliable friends and whomever you want to accompany you. Go to Egypt because going to Egypt will further scare your enemy and make your commandership more victorious. As and when you arrive in Egypt, God willing, treat the good doers well and be hard on those who entertain a doubt. Behave with compliance and leniency with elites and common people because it is befitting for you to do so."
Qays said in answer: "O Commander of the Faithful, may Allah bless you. I understood what you said but what you said to me about going to Egypt with the army, I swear by Allah that I will not go to Egypt with the escort of the army which I have brought from Medina; rather I will leave it for you so that it may be accessible in case there is a need to use it. Should you want to dispatch it to a place, it would be there under you command. I will go to Egypt with only my family accompanying me. As for compromising and being kind to others, God, the Exalted, is my helper in this regard."
Thereupon, Qays and few of his friends left the city and went to Egypt. Given the fact that Qays was a good warrior, experienced in warfare and head of his own clan, he played a very important role in Imam Ali's battles. On the way to Siffin, he addressed the Imam as such: "O Commander of the Faithful, help us overcome the enemy quickly; do not abandon (the battle). I swear in Allah that fighting them is more pleasing to me than fighting the Turks and Romans because these people [who are Muslims only by appearance] played a trick in the religion degrading and humiliating God's servants, the muhajir and ansar and the good doing faithful from the companions of Muhammad (S)."
Qays remained faithful to Imam Hasan after the demise of the Commander of the Faithful, Ali (AS). He served as a deputy of Ubaidullah bin Abbas in Imam Hasan's army. Even when Ubaidullah committed treason and defected to Mu'awiyah, Qays remained with the Imam committed and unflinching. He did not vow allegiance to Mu'awiyah until Imam Hasan (AS) entered a truce with Mu'awiyah and ordered to pledge allegiance to Mu'awiyah.However, Qays was not a captive of Mu'awiyah even after he pledged allegiance to him. He stood against him overtly and covertly. A conversation has been recorded in history between Mu'awiyah when he was Muslims' caliph and Qays. The conversation is indicative of this Shia man's courage and bravery:
"During his caliphate, Mu'awiyah entered Medina with the intention of performing Hajj. The people of the city went to welcome him but he did not see among them anyone except Quraish. So, he dismounted and said: "What has happened to Ansar and why haven't they come to welcome me?!"
Qays who was the head of the Ansar and the son of their chief gave a sarcastic answer:
"They have left their camels in the battles of Badr, Uhud and other places while fighting alongside the Messenger of Allah (S) on the days when they defeated you and your father for the sake of Islam until the divine will prevailed (and made Muslims triumphant)."
Mu'awiyah kept silent and Qays went on saying: "Beware that the Messenger of Allah promised that we would encounter a transgressor."
"What did the Prophet (S) order you to do?" asked Mu'awiyah.
He said: "We wait until we rejoin him."
Mu'awiyah replied: "Then wait till you rejoin him."
As mentioned earlier, Imam Ali (AS) appointed Qays as governor of Egypt and he also stood up well against Mu'awiyah fulfilling his responsibility properly. As for why Imam Ali (AS) removed him from the government despite willing to keep him as governor, the story about it is beautiful and readable. This is one of rare incidents in which a Muslim ruler is forced to depose one of his chief and competent commanders due mainly to the cunningness of the enemy that resorted to false propaganda and aimed to create dissention. The deposition story is as follows:
Mu'awiyah and Qays exchanged letters and when Mu'awiyah gave up hoping that Qays would comply with his authority, it made him very anxious, for he was well aware of Qays's determination and strength of character. So Mu'awiyah feigned to the people around him that, "Qays bin Sa'ad is on your side, so say prayers for him to Allah!" He then read out to them the letter in which Qays had been compliant and accommodating toward Mu'awiyah. He further fabricated a letter from Qays bin Sa'ad and read it aloud to the Syrians:
In the Name of Allah, the Compassionate the Merciful
To the Ruler Mu'awiyah bin Abi Sufyan from Qays bin Sa'ad.
Greetings! I praise Allah to you. There is no god but He! After greetings, Uthman's murder was a great incident. I have considered the situation and I now realized that I can no longer support a party that killed their imam, a Muslim, unlawful to be killed, who was fulfilling his duties and was God-fearing. We therefore beg Almighty and Glorious Allah pardon for our sins and ask Him to preserve our religion from error. Here I come in peace to you, responding to your call to fight the killers of Uthman, the unjustly killed imam of guidance. So asked my assistance regarding whatever money and men you would like, and I will expedite them to you. Peace!
At this the news spread among the Syrians that Qyas bin Sa'ad had given allegiance to Mu'awiayah bin Abi Sufyan. Ali bin Ali Talib's spies conveyed it back to Ali (AS) and when he heard it he was distressed, shocked and very surprised. He called his sons, Hasan and Hussein and Abdullah bin Ja'far telling them. "What did you think?" He asked. Commander of the Faithful," replied Abdullah b. Ja'far. "Leave what you suspect for what you don't suspect! Remove Qays from Egypt!" By Allah! I cannot credit this from Qyas," Ali answered them. "But Commander of the Faithful," replied Abdullah bin Ja'far, "remove him! Then, by Allah, if this news is true, he will not step down for you when you remove him."
They were talking in this way when a letter from Qays bin Sa'ad arrived containing the following:
In the Name of Allah, the Compassionate the Merciful
After greetings, I inform the Commander o the Faithful, may Allah ennoble him! That there are men facing me here who are abstaining. They have asked me to hold off from them and leave them alone until matters between the people have been put in order, at which time we may come to a decision and they may. I therefore thought it wise to hold off from them and not to rush into battle with them, but in the meanwhile to try to win them over. Perhaps Almighty and Glorious Allah will make their minds more favorable to us and separate them from their errors, if He will. God willing, Peace!"
"Commander of the Fiahtufl!" said Abdullah bin Jafar. "I am very afraid that this means he is in fact joining forces with them. If you accept this act on his part and leave them to themselves to give up allegiance, it will escalate the situation and mischief will arise because in many place where people want to give allegiance, they will stop vowing allegiance under the pretext to see where the developments lead to. Order him, Commander of the Faithful, to fight them!" Ali (AS) therefore wrote to him:
In the Name of Allah, the Compassionate the Merciful
After greetings, Go to these people you mention! If they make allegiance to me as the Muslims have done, all well and good. But, if they do not, then fight them. God willing! Peace!"
When the letter reached Qays bin Sa'ad and he read it he could not but write back to the Commander of the Faithful:
After greetings. Commander of the Faithful, I was astonished at your order. Are you ordering me to fight people who are holding back from leaving you free to fight your enemy? They will support your enemy against you if you go to war with them. Follow my advice, Commander of the Faithful! Hold back from them! Leaving them alone is the best thing to do. Peace!"
When this letter reached Ali (AS), Abdullah bin Ja'far said to him, "Commander of the Faithful! Send Muhammad bin Abi Bakr to rule Egypt! He will take care of it for you. Remove Qays! By Allah, I have heard that Qays says: 'By Allah! A rule that is only established by killing Maslamah bin Mukhallad is a bad rule indeed! By Allah, I have no wish even to rule Syria along with Egypt as the killer of Ibn al-Mukhallad.'"
So Ali sent Muhammad bin Abi Bakr as governor of Egypt and removed Qays. The Commander of the Faithful, Ali (AS) wrote a letter for [Muhammad b. Abi Bakr] to take to the Egyptians. On his presenting it to Qays, Qays said to him: "What is the Commander of the Faithful doing? What has changed his mind? Has someone been saying things to him against me?"
According to some other reports, Ash'ath and some other people put pressure on Imam Ali to depose Qays and he did so at their advice.
Indeed, the rumor which was worked out and spread by Mu'awiyah as well as the pressure by some of the Imam's aides caused him to remove Qays from the governorship of Egypt whereas in fact the passage of time showed that Qays's advice for the Commander of the Faithful about those who stepped aside was better than that of Abdullah bin Abbas or Ash'ath. However, even after this incident, Imam Ali (AS) chose him as one of his close aides and listened to his advice.
 Ibn Abdul Bar, Yusuf bin Abdullah, Al-Isti'ab fi Ma'refat al-Ashab, researched by Bajawi, Ali Muhammad, vol.3, p. 1289, Beirut, Dar al-Jayl, first edition, 1412 A.H.
 Ibn Kathir al-Damashqi, Ismail bin Umar, Al-Bedayah wa al-Nehayah, vol.8, p. 99, Beirut Dar al-Fikr, 1407 A.H.
 Maghrebi, Qazi Nu'man, Sharh al-Akhbar fi Fadhail al-A'emmah al-Athar, vol.2, p. 28, Islamic Publications Office, first edition, 1409 A.H.; Ibn Abil Hadid, Abdul Hamdi, bin Hebatullah, Sharh Nahjul Balaghah, researched and corrected by Ibrahim, Muhammad Abulfazl, vol.10, p. 112, Qom, Ayatollah Mar'ashi Najafi Library, first edition, 1404 A.H.
 Al-Isti'ab, vol.3, p. 1290.
 Sharh Nahjul Balaghah Ibn Abil Hadid, vol.6, p. 59.
 Thaqafi, Ibrahim bin Sa'eid bin Helal, Al-Gharat Aw al-Istinfar wa al-Gharat, researched and corrected, Jalaluddin, vol.1,p. 127 - 128, Tehran, National Heritage Association, first edition, 1295 A.H; Hashemi, Khoei, Mirza Habibullah, Minhaj al-Bara'ah fi Sharh Nahj al-Balaghah, researched, corrected, Miyanaji, Ibrahimn, vol. 5, p. 106; Tehran, al-Maktabat al-Islamiyah, fourth edition, 1400 A.H.
 Nasr bin Muzahem, Waq'at Siffin, researched and corrected , Haroon, Abdul Salam Muhammad, p. 93, Qom, Ayatollah Al-Mar'ashi al-Najafi Library, second edition, 1404 A.H.
 Ibn Shahr Ashub Mazandarani, Manaqib Aal Abi Talib (AS), vol.4, p. 28, Qom, Allamah Publications, first edition, 1379 A.H; Arbali, Ali bin Isa, Kashful Ghummah fi Ma'arefat al-A'emmah, researched and corrected, Rasuli Mahallati, Hashim, vol.1, p. 541, Tabriz, Bani Hashemi Publications, first edition, 1381 A.H.
 Husseini Musavi, Muhammad Tasliyat al-Majalis wa Zinat al-Majalis (Maqtal al-Hussein), researched, corrected, Hasoon, Karim Faris, vol.2, p. 46, Qom, Al-Ma'aref al-Islamiyah, first edition, 1418 A.H.
 Kashi, Muhammad bin Umar, Ikhtiyar Ma'refat al-Rijal, researched, corrected, Sheikh Tusi, Miuhammad bin Hasan, Mustafavi, Hasan, vol.1,p. 326, Mashad University Press, first edition, 1409 A.H; Ibn Athir Jazri, Ali bin Muhammad, Asad al-Ghabah fi Ma'refat al-Sahabah, vol.4, p. 126, Beirut, Dar al-Fikr, 1409 A.H.
 Tabarsi, Ahmad bin Ali, al-Ihtijaj Alaa Ahl al-Lujaj, researched, corrected, Khurasan, Muhammad Baqir, vol.2, p. 294, Mashad, Murteza Publication, first edition, 1403 A.H.
 Al-Gharat, vol.1, p. 134 - 137; Sharh-e Nahjul Balaghah by Ibn Abil Hadid vol.6, p. 61 - 63.
 Al-Isti'ab,vol.3, p. 1290.
 Miskawayh Razi, Abu Ali, Tajarob al-Umam, researched, Imami, Abul Qasim, vol.1, p. 511, Tehran, Soroush, 1379 (2000).
source : www.islamquest.net