There's a popular attitude that you can eat anything so long as you exercise and burn those calories off. While some people may have a better metabolism than others, the fact is that even those people who don't gain weight because they burn off all their calories could be better served by not allowing themselves to eat what they please.
Calories Burned vs. Calories Consumed
While you shouldn't allow yourself to eat anything at all times because you work out, there is some truth to the idea that you won't gain weight if you burn off the excess calories that you ingest. However, to truly burn off your excess calories, you need to take careful note of the number of calories in the foods you eat as well as the number of calories your workout routine likely burns off. Taking a walk every few days can be good exercise, but it's not as intense as advanced strength training or running a marathon. Eating an entire cake, then, may not be burned off by your regular walks and you may need to engage in more rigorous workout activity to "justify" the indulgence.
Difference between Occasional Indulgence and Overeating
If you work out regularly, you can indulge occasionally. If you eat anything you want at any time you want and justify it because you work out regularly, you're missing the point of being able to indulge due to your workout routines. Working out regularly means that you're burning off more calories than you would if you sit for most of the day.
Treating yourself by having a once-a-week sweet treat or fast food meal shouldn't affect your body much if you work out regularly and eat healthy the rest of the time, and you'll still be on track to maintain a healthy weight because you'll have eaten fewer calories than you've burned off. However, if you eat whatever you please every day, your workout routine won't be able to catch up to the amount of calories you're eating. You can still gain weight while working out regularly if you overeat instead of occasionally indulge.
Food that Can Benefit Your Body
There's more to the idea that you can eat anything that may impede your health besides calorie counting and occasionally indulging. It's important that you think about eating foods that will benefit your body, especially if you're engaging in more physical activity than you used to. You want foods that will give you ample energy to complete your workout and foods that will help you meet your daily needs for vitamins and minerals so that you can build a stronger, healthier body.
What foods will benefit your body depends on your individual weight loss and fitness goals as well. Some committed athletes may seem to eat anything they like, but they may actually be following a prescribed diet for their intense level of activity that's high in protein and carbohydrates. If your workout routine is less intense, you can't eat the same diet. Likewise, if you're carb-sensitive, you may need to eat just the right amount of carbs to give you energy without overindulging in them, so that you don't gain weight.