In general, the source code shows what is being served to the browser, and Firebug basically shows how the browser interprets it.
In this case, the root of the problem is the fact that there are a number of empty characters before the DOCTYPE declaration (or a TAB character), which confuses the browser. Maybe there’s some other issues as well, but if you make sure that those the very first characters of the document aren’t empty, I believe that might solve it.