There lived amongst Bani Isra`il, a person who was so sinful and immoral that they eventually had him expelled from their midst.
Once, while wandering around, he came across a pious worshipper, above whose head flew a pigeon casting its shadow over him (thus protecting him from the sun). He said to himself: “I am a Banished person but this man is a pious individual; if I sit near him it is possible that due to his piety, Allah may show mercy upon me too.”
With this in mind, he approached the worshipper and sat down beside him. On seeing the exiled man sit next to him, the worshipper thought to himself: “I am the pious worshipper of this tribe whilst he is a disreputable, Banished and despised sinner; how can he sit down beside me?” Turning his head away from the man, the worshipper ordered him to go away from him.
Just as he had uttered these words, Allah revealed to the prophet of the time: “Go to those two persons and ask them to start their deeds afresh, for I have forgiven all the sins of the immoral person and erased all the good deeds of the worshipper,” (for exhibiting self-conceit and holding the other person in contempt). ( Shanidani-ha-e-Tarikh, Page 373; Mahajjatul Baiďa, Volume 6, Page 239 )