To the Prophet (pbuh), ‘Abdullah bin Ubai bin Salul, the chief of hypocrites in Al-Madinah, was a worse enemy than the disbelievers. He was the one who rudely treated the Prophet (pbuh) when he (pbuh) first arrived in Al-Madinah and happened to pass by a gathering in which ‘Abdullah bin Ubai bin Salul was present, before ‘Abdullah embraced Islam.
The Prophet (pbuh) greeted them, stopped, and dismounted. He (pbuh) then invited them to Allah Almighty and recited to them some Ayat of the Noble Qur’an. At that point, ‘Abdullah bin Ubai said to him, “O man! There is nothing better than what you say, if it is true. So, do not bother us with it in our gathering. Go back to your house, and if anyone comes to you, narrate (your tales) to him.” (Sahih Al-Bukhary).
After a hypocritical show of faith in Islam, ‘Abdullah bin Ubai bin Salul kept conspiring against the Prophet (pbuh) and incited the people against him, saying:
Spend not on those who are with the Messenger of Allah until they desert him.” And: “If we return to Al-Madinah, indeed the more honorable (meaning himself) will expel therefrom the meaner (meaning the Messenger (pbuh))
More of his evil showed through forcing his two slave women, Musaika and Umaimah, to commit prostitution; and the leading role he played in forging and spreading the slanderous story against honorable Lady ‘Aishah (may Allah be pleased with her), the Prophet’s wife (pbuh). (Sahih Muslim)
Nevertheless, Ibn ‘Umar narrated that when ‘Abdullah bin Ubai died, his son, ‘Abdullah bin ‘Abdullah, came to the Messenger of Allah (pbuh), who gave him his shirt and ordered him to shroud his father in it.
In another report, Jabir bin ‘Abdullah said: “The Prophet (pbuh) came to the grave of ‘Abdullah bin Ubai, brought him out of his grave, placed him on his knees, breathed his (blessed) saliva on him, and clothed him in his own shirt.”(Sahih Muslim).
The Prophet (pbuh) then stood up to offer the Funeral Prayer for him, but ‘Umar bin Al-Khattab took hold of his garment and said:
Would you offer the Funeral Prayer for him although he was a hypocrite, and Allah has forbidden you to ask forgiveness for them (hypocrites)?” He (pbuh) said: “Allah has given me the choice (or Allah has informed me), saying: Ask forgiveness for them, (O Muhammad), or do not ask forgiveness for them. If you should ask forgiveness for them seventy times, never will Allah forgive them
Then he (pbuh) said: “I will ask (forgiveness) for him more than seventy times.” The Messenger of Allah (pbuh) offered the Funeral Prayer for him, and they (the Companions) joined him in the prayer. Then Allah sent down to him: "Do not pray (the Funeral Prayer, O Muhammad) over any of them who have died – ever – or stand at his grave. Indeed, they disbelieved in Allah and His Messenger and died while they were defiantly disobedient." (At-Tawbah 9: 84).