You forget that Facebook code is executed inside a browser (for example it doesn't have to render UI because HTML/CSS engine does that) while "desktop chat applications" can contain a Webkit engine, Node.JS and a lot of bloated uncompiled libraries.
7Mb of Javascript is too much. 200-300 Kb should be enough to view photos and post comments.