Superheroes need a place to meet, plan, relax and sometimes live. The hero working alone doesn't necessarily need a headquarter as they can use their apartment as their base of operations. When you have a team of heroes, the need for an actual location to meet becomes more necessary.
For a team to function properly, they need to spend time training and getting to know each other. Some heroes devote themselves so much to saving innocents that they don't have time to keep a job and cannot pay for their own place. The superhero headquarter is essential in making a successful team.
Because superheroes want to be seen as a symbol of hope and want to have a place easily accessible to the members of the team, they'll often keep the location public. The Avengers had the Avengers Tower and Mansion, the Justice League had the Hall of Justice, the Fantastic Four has the Baxter Building, the Teen Titans had the Titans Tower, the X-Men had the school and Utopia and so on. With so many deadly villains out to get them, is it really a good idea to let the world know where they're hanging out?== TEASER ==
At some point in the team books' run, there'll be a story (if not several) where the headquarters is attacked. Supervillains do get ticked off and will sometimes hatch crazy schemes to try to defeat the heroes where they're the most vulnerable.
Superhero teams aren't stupid. They have to realize villains will try to destroy their place, especially if it's already been done several times before. As long as they have the means, they will ensure that the place has the utmost fancy security system. For many, it's not just a place to meet and talk about the bad guys, it's also their home. But even the smartest heroes can't prevent every attack.
Recently the Avengers Tower was destroyed during Fear Itself. With Tony Stark and all the intergalactic members the Avengers have had over the years, you would think a person couldn't even sneeze in the direction of the Tower without prior detection. Yet for some reason, Stark thought having a giant tower in the middle of New York City would make a great headquarter.
At least the Avengers still have the Avengers Mansion, right? Not really. If you read New Avengers Annual (which must take place after Avengers #18), you know that the mansion was attacked and virtually destroyed. They had two separate headquarters (for the different teams) and both were destroyed due to their location being public knowledge.
The Fantastic Four have had the Baxter Building since their first appearance. Reed Richards is one of the smartest men in the Marvel Universe. He would make sure the building was secure. Not only does the team live there but their children (and now the Future Foundation) do as welll.
Also, the FF only occupy the top four floors. The rest of the building is office space with who knows how many innocent civilians. Remember how easily an inexperienced Spider-Man crawled through an open window? Or more importantly, what about the times Doctor Doom sent the entire building out into space (yes, I know it was Kristoff one time).
Imagine working in an office and you went out for your lunch break. You come back and find all your stuff is now flying out into space. That'd be quite the bummer. It would also be pretty bad if you were actually inside the building and it exploded.
The X-Men had the bright idea to use a school as their headquarters. A school...with children. It could make the perfect cover. No one would expect a school for gifted children to really be the secret headquarters for superheroes. But then they decided to go public. Xavier told the world about the X-Men. As a result, a busload of 'New' X-Men were killed when William Stryker decided to try to eradicate the mutants. And the school was destroyed later as well.
The Teen Titans have also gone through a few different headquarters. The latest they had, pre-New 52, was a giant building in the shape of a T with basically walls of glass. When we asked current Teen Titans writer, Scott Lobdell, if the new team will still have the Titans Tower, this was his response:
No. The Teen Titans are going to be much too busy and much too hunted to erect a ten story glass tower on a small island off of a major city where every villain on the planet can find them on Google.
They all need a place to go but letting everyone, including their enemies, know where is a horrible idea. Something like the Avengers Tower or Baxter Building could be seen as a symbol of hope for the city residents. They might feel a little more at ease knowing the heroes are nearby should Galactus or Kang the Conqueror decide to attack. At the same time, the average person might not want to live or work by these places.
When the place gets destroyed during an attack, what does that say about the symbol of hope? Would it put people into despair seeing their hope shattered?
Villains don't play by the rules these days. We are seeing more of them become deadlier than they've been portrayed before. If they had the knowledge of where the heroes or their loved ones sleep, they would use that to their advantage. The heroes might have the most advanced security systems in place but even if they used alien technology, there's always going to be a villain that could find a way to destroy it. A symbol of hope is a nice idea but the heroes might as well paint a giant red target on the roof if they insist on telling the world where they're at.