Uqba bin Abu Muayt is another individual who is portrayed by critics as an innocent person and that Mohammad (p) had no reason to get him killed. However, historical sources show that Uqba was not as innocent as they make him out to be. While the Prophet resided in Makkah, Uqbah brought intestines of a camel and threw them on the Prophet while he was praying.
Narrated `Abdullah: While the Prophet was in the state of prostration, surrounded by a group of people from Quraish pagans. `Uqba bin Abi Mu’ait came and brought the intestines of a camel and threw them on the back of the Prophet. The Prophet did not raise his head from prostration till Fatima (i.e. his daughter) came and removed those intestines from his back, and invoked evil on whoever had done (the evil deed).
The Prophet said, “O Allah! Destroy the chiefs of Quraish, O Allah! Destroy Abu Jahl bin Hisham, `Utba bin Rabi`a, Shaiba bin Rabi`a, `Uqba bin Abi Mu’ait, Umaiya bin Khalaf (or Ubai bin Kalaf).” Later on I saw all of them killed during the battle of Badr and their bodies were thrown into a well except the body of Umaiya or Ubai, because he was a fat person, and when he was pulled, the parts of his body got separated before he was thrown into the well. (Sahih al-Bukhari Volume 4, Book 53, Hadith 409)
As well as this, he wrapped a sheet around the Prophet’s (p) neck and tried to kill him.
Narrated `Urwa bin Az-Zubair: I asked `Abdullah bin `Amr, “What was the worst thing the pagans did to Allah’s Messenger?” He said, “I saw `Uqba bin Abi Mu’ait coming to the Prophet while he was praying.’ `Uqba put his sheet round the Prophet’s neck and squeezed it very severely.
Abu Bakr came and pulled `Uqba away from the Prophet and said, “Do you intend to kill a man just because he says: ‘My Lord is Allah, and he has brought forth to you the Evident Signs from your Lord?” (Sahih al-Bukhari Volume 5, Book 57, Hadith 27)
Furthermore, Uqba on a number of occasions persecuted many Muslims. Safi-Ur-Rahman al-Mubarakpuri writes:
When they reached As-safra, he ordered that two of the prisoners should be killed. They were An-Nadr Bin Al-Harith and Uqbah Bin Abi Muait, because they had persecuted the Muslims in Makkah, and harboured deep hatred towards Allah and His Messenger (p). In a nutshell, they were criminals of war in modern terminology, and they execution was an awesome lesson to oppressors. 
Apart from all the above, Uqba even engaged in battles against the Muslims. He never ceased from his evil until the day he was caught by the companions of the Prophet (p) and ordered that he be executed.
It was narrated that ‘Amr bin Maimun said: “Abdullah told us: ‘The Messenger of Allah was praying at the House (the Ka’bah) and a group of the nobles of Quraish were sitting there. They had just slaughtered a camel and one of them said: “Which of you will take these stomach contents with the blood and wait until he prostrates, then put them on his back?” ‘Abdullah said:
‘The one who was most doomed got up and took the stomach contents, then went and waited until he prostrated himself, and put it on his back. Fatimah, the daughter of the Messenger of Allah, who was a young girl, was told about that, and she came running and took it off his back. When he had finished praying he said:
“O Allah! Punish the Quraish,” three times, “O Allah, punish Abu Jahl bin Hisham, Shaibah bin Rabi’ah, ‘Utbah bin Rabi’ah, ‘Uqbah bin Abi Mu’ait” until he had listed seven men from Quraish.’ ‘Abdullah said: ‘By the One Who revealed the Book to him, I saw them dead on the day of Badr (their corpses) in a single dry well.’” (Sunan an-Nasa’I, Volume 1, Book 1, Hadith 308)
 Ar-Raheeq Al-Makhtum – The Sealed Nectar: Biograpghy of the Noble Prophet By Safi-Ur-Rahman al-Mubarakpuri page 143 – 144