It is flaw of human design that puts the bridge/ cockpit at the front/top of the vessel when it is not required. the invention of fast communication to all sectors of a ship and the total reliance on cameras, sensors and view screens means that the bridge can be any where on a ship with out any degrading of efficiency. Meaning that it can be deep in the hull of the ship protected by armor.
Since the bridge is the brains of the ship, it is the part of the ship that needs updating the most. Being at the top of the ship, the entire bridge is detached and replaced by a completely new bridge module. Besides, the weapons in Star Trek are much more powerful than those in BSG. Without shields, no part of the starship is safe so it wouldn't matter if the bridge was deep in the hull. Admiral William Thomas Riker 00:31, October 17, 2011 (UTC)
I always thought it was naval tradition to have the bridge at or near the top of the ship. For an ocean going surface ship this makes sense because it provides the best visibility to the crew. It makes little sense for a space ship that relies on sensors. What you see in BSG where Adama & the other stand is the CIC. I think in one episode they actually show the pilothouse where the helm was (that might or might not have been on the Pegasus). The NX-01 had something remotely like a CIC, the command center, which was installed after the Xindi attack and Ent was recalled to Earth. Why it was not continued on future starships is unknown. On the Ent-D you could think of the battle bridge as a sort of CIC if it was manned during a red alert. The way we see it on Star Trek is just convenience for television, having a majority of the main actors in one place. In real life the captain and tactical officier would be in CIC directing the weapons and sensors while the XO remained on the bridge with a crew and be repsonsible for flying the ship.
The reason from a production standpoint is that Gene Roddenberry had it done in such a way from the very start. The idea was that the audience could get a sense of the scale of the ship by having the bridge as a reference. While not perfectly followed later on (for example, deck 1 on the Galaxy class includes the Ready Room, the Observation Lounge, and possibly several other structures depending on what blueprints you prefer), the general idea is kept the same throughout Starfleet vessels.
There are at least two in-universe possibilities as well.
The first is shield strength. Depending on what you're using as a reference (the TOS movies where the Enterprise took several hard beatings against the hull, versus early TNG where a single photon torpedo that detonated too closely could supposedly destroy the entire ship), placing the bridge dead-center in the saucer section wouldn't have provided much benefit, as an attacker that had destroyed the shields could slice through the hull like cake anyway - being close to the shield generators could give a bit more of an edge by ramping up more power to directly defend it. This argument is less successful given ships like the Defiant with high-quality armor, and possibly ships such as the Sovereign that might have similar high-quality armor, but even among the ships that were highly upgraded during the Dominion war, that level of armoring is the exception rather than the norm, and it's probably more than a trivial matter to build an entire new bridge in the center of, say, an Excelsior-class ship.
The second is the potential for an upgrade. To avoid extensive rewiring, rebuilding, and all sorts of things, the bridge could be treated as a plug-in module. I believe (but I am not sure) it is suggested that this is what happened for the sudden upgrade of the Battle Bridge during season 4, though it seems a bit extreme for the upgrades to the main bridge seen in Generations. However, it would explain the repeated bridge changes seen in the TOS movies, to be certain. This may fall a little flat with modern Starfleet ships, given the fact that you can - literally - fly the ship from a PADD while walking down the hallway with the appropriate command codes (according to the manual), but the bridge has at least some secured/redundant connectivity, so it's arguable there would still be some benefit in upgrading the entire thing as a plug-in module.