Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) narrates that the Prophet (peace and blessings be upon him) said: "Whoever's prayer does not restrain him from indecency and wrongdoing keeps moving farther away from Allah Almighty."
This narration was recorded by Imam al-Tabarani in al-Mu'jam al-Kabir; its chain contains a narrator, Layth bin Abi Sulaym, who is "thiqah" (trustworthy), but he is a mudallis (one who conceals defects in the chain).