If one's prayer does not prevent him from bad deeds, then know | Ilm4all
If one's prayer does not prevent him from bad deeds, then know that there is deficiency in his prayer (i.e. he is not praying properly or lacking Khusoo etc.).
Allaah تعالى says:
إِنَّ الصَّلَاةَ تَنْهَىٰ عَنِ الْفَحْشَاءِ وَالْمُنكَرِ { Indeed, prayer prevents from immorality and wrongdoing.} [Surah al - Ankaboot (29):45]