The answer to this question (which matters more, diet or exercise) depends on the context of the question.
If you are asking about which is best for your overall health, the scientific evidence thus far comes down on the side of the importance of exercise. Moving our butts on a regular basis -- even if it's doing everyday activities such as taking stairs instead of elevators, walking between offices instead of emailing, doing yardwork and housework, parking farther away from the door of the store than you have to -- protects against heart disease, some kinds of cancer, diabetes, makes us sleep better, and a whole lot of other great benefits.
But if you are asking about weight control, I am convinced that diet trumps exercise for keeping the pounds off. A recent visit to my doctor reinforced that belief.
He said: Your exercise habits are terrific, keep it up. But if you want to lose weight, you have to watch what you eat very carefully. And eating healthy foods is not the whole story; you also have to watch portion size. If you eat too much (too many calories) you will gain weight, or at least you'll be unable to lose pounds.
Words to the wise!