While learning Torah lishma, for the right reasons, is a great level, even learning for the wrong reasons is considered a great thing, as it can eventually bring one to learn for the right reasons.
Another trick is that the evil inclination has a person believe that the focus should only be on purity of heart, and tricks him to miss the proper time of the mitzvah or prayer.