After enumerating many of the mitzvos, the Torah writes, "And you shall guard everything that I have said to you, and the names of other gods you shall not mention" (Shemos 23, 13). Rashi explains the connection between the first half and second half of the pasuk. The Torah is implying that worshipping other gods is tantamount to transgressing all of the mitzvos, and conversely, refraining from idol worship is equivalent to fulfilling all the mitzvos.
Rav Wolbe writes (HaMitzvos HaShekulos pg. 7) that it is quite understandable why he who worships idols is compared to one who has transgressed all the mitzvos. The Ramban explains this idea quite succinctly: "Once one admits to another god, he has inevitably invalidated everything that Hashem commanded - both positive and negative commandments - for if there is another god then there is absolutely no necessity to fear Hashem and heed His commandments." However, the flip side of the coin is much more difficult to understand. Why is it that when one refrains from avodah zarah, he is automatically considered as if has fulfilled all the mitzvos? Isn't it quite possible that a person might realize the uselessness of idols but still have no interest in keeping the mitzvos? If we take a closer look at human nature we will succeed in answering this question.
We say in the Shabbos morning davening, "There is nothing like Your value in this world." Every person has a set of things that he values. Some are of lesser importance and some of greater importance, and almost always there is one thing that is of utmost importance. It might be money, honor or even collecting stamps. Yet, the only true and absolute entity of value is Hashem. The Rambam writes that everything a person does - his eating, drinking, healthy activities etc. - should all be carried out with one intention in mind: the service of Hashem. Often eating and drinking becomes of intrinsic value in and of itself, and healthy activities (e.g. sports) most certainly are perceived by many as something of supreme value. Even wisdom can become an end unto itself. Taking anything that is of value which should be used in the service of Hashem and assigning importance outside the realm of avodas Hashem, is to a certain extent the creation of an avodah zarah!
We can now understand why he who refrains from avodah zarah is compared to one who has performed all the mitzvos. Refraining from avodah zarah means that he perceives everything in the world as a means of serving Hashem. There is nothing that has intrinsic value unless it is used in His service. Such a person most certainly can be considered as if he performed all the mitzvos since everything he does and values is with a single purpose - the fulfillment of Hashem's commandments.
What role does money, honor, pleasure seeking or food play in our lives? There is nothing wrong with any of the above - as long as they are used to bring us closer to Hashem!