It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever's prayer does not restrain him from indecency and evil, he increases in nothing but distance from Allah."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 10979