"Im teilchu imi b'keri," for which the punishments of the tochacha are given, refers to the abandonment of Torah and mitzvos. The preceding wrongdoing, "Im lo tishme'u li," must be some other defect. The Netzi"v explains that the key word in the phrase is "li" -- the pasuk doesn't mean mitzvos are not being done; it means mitzvos are being done for reasons other than their being Hashem's command. But so what -- Mitoch she'lo lishma ba lishma? We accept a lack of lishma as an important stepping-stone toward eventually doing things for the right reasons. Why is it deserving of such harsh punishment here?
The Netziv answers that while on an individual level mitoch she'lo lishma ba lishma, the same is not true on a communal level. Society cannot institutionalize a b'dieved -- it has to be built on ideals.
I think this is an important principle in general, not just with respect to lishma. A yeshiva, a shul, a community organization should at least on the books have as its mission statement nothing short of excellence.