One should always engage in Torah and mitzvot even not for their own sake, for from doing them not for their own sake, one comes to do them for their own sake

לעולם יעסוק בתורה ומצות שלא לשמה שמתוך שלא לשמה בא לשמה
Shiurim in this topic
3841. Unwanted Thoughts and Acting with Ulterior Motives מחשבות לא רצויות ועשייה עם מניעים צדדיים