I was about to post this question and found this one on search and noticed that the top answer is incorrect, so this is to bump it.
I gave this question to our engineering coop at work (who is into leangains) and he hacked it in 20 minutes with diagrams. Smart kid.
The first law of thermo has fine print, and people didn't read the whole law!
The first law, conservation of energy, only applies to a closed system. Humans eating, pooping and living are not a closed system. There are more chemical processes going on inside that do things with energy that are not observable from the outside.
Much of nutrition and fitness use the first law as literally true, and they are all mistaken.
It's actually pretty close in the long run, but it's still the wrong argument.