If you're going to the gym to burn calories, you're going for the wrong reasons. There's no better way to burn off excess calories than by not eating them. Exercise is a ridiculously inefficient way to burn calories and get rid of fat.
Just because burning calories from exercise will never replace proper diet doesn't mean its worthless. You can easily double your weight loss rate by going to the gym a few times a week. Far from worthless in my books.
You're both right. He never said that gym time wouldn't help you lose weight, just that, if it's the only reason you're going to the gym, you're doing it wrong.
You can have the best of both worlds. If you just spend 3 or so hours/week at the gym lifting heavy things in a focused, disciplined manner, you won't have to worry about eating too much, you'll have to worry about not eating enough. And the types of food that you want to eat will change too. It's almost magic. Sugars, fatty foods, excessive carbs, etc will just start to seem unappetizing.