This always bothered me, too. It was DUMB to have both Starfleet's and tbe Federation HQ located on Earth with no observable backups on other planets (equally dumb is that Riker's commments about Earth in Nemesis seem to reinforce this). Even the US Government's agencies have contingencies, and the Air Force has its headquarters in another country. Maybe some writers out there have considered a secret alternate Federation HQ buried deep underground on Vulcan or something, but this should be common sense to put something addressing this in scripts. At the very least, a Federation HQ should be located on a neutral member planet, maybe even a moon, in case Earth is wiped out.