That might mean your current map has a fatal error that prevents VBSP (the first compile stage of 3) from generating a BSP file that VVIS and VRAD (stages 2 and 3, visibility calculations and lighting) need, so Hammer quits compiling and loads up TF2 with the last working version.
http://www.interlopers.net/errors?page=errors <-- paste your compile log in here and see what it spits out, any errors in your compile will be noticed by the checker and it'll also tell you how to fix it.