In the second paragraph of the Shema, Hashem promises us abundant financial blessings as a reward for doing Mitzvot. Only when the description of rewards for Mitzva observance is completed does the Torah say, השמרו לכם פן יפתה לבבכם, “Beware for yourself, lest your heart turn astray.” The Torah then continues with punishments for sinning.
Why did the Torah not just say to do Mitzvot and refrain for sin, and then describe the consequences for each? A Midrash on Parshat Noach may provide the answer.
The Midrash says that before the flood, people had great lives. Children could walk and talk from the day they were born. People lived for hundreds of years, and no one died without seeing their children and grandchildren. They never had to go through the heat of summer and the cold of the winter; instead, they had mild spring weather year-round. The generation before the flood also possessed great strength, to such an extent that they considered lions harmless and could uproot whole trees. In addition, they did not become weak in old age, but only got more powerful. They also had very little work to do. One year’s crop was sufficient to feed them for forty years. They knew no suffering at all.
Instead of using all these blessings for a good purpose, they rejected Hashem. They said that they did not need His help for anything. Based on this “logic,” they committed the three cardinal sins, and they stole constantly. In the end, they were all wiped out.
From this Midrash, we see that we must be careful to remember that Hashem gives us everything that we have, and we must be thankful. The reason that the section of Shema about sins comes right after the description of material blessings is to warn us to not become arrogant in good times. Rather, we must use the resources we have – talents, possessions, etc.- to follow the Torah and do good things.