He blessed his grandsons that they should merit to grow in Torah. It should be their prime focus and direct their lives. They could then focus on avodah and gemilus chasadim. Those are the social mitzvos that engender incredible reward. This Mishnah seems to imply that while social mitzvos are certainly important, they do not replace Torah study.
Study retains primacy over all other mitzvos.
The text, however, does not support this interpretation. Horav Katz explained that the Mishnah teaches us an important lesson. Establishing a shul is truly a wonderful undertaking, but one must address the appropriateness of the time and place of this mitzvah. Peforming an act of altruism does not grant one license to do as he pleases. Everything we do must be addressed by the Torah or the act loses its credibility.