Doesn't that seem like they're putting a lot of innocent people at risk?
But they would be doing the exact some thing by "leaving them behind." The 24th century is a dangerous place, Planets are attacked, civilian populations are wiped out. The long war with the Cardassians (pre-Dominon war) iirc
cost millions of lives, it's doubtful all of those deaths were solely from starships. During the Dominion war San Fransisco was attacked by the Breen, if say one percent of the people in San Fransisco were casualties, how many attacks on starships (where again one percent of the people were casualties) would it take to equal the attack on San Fransisco? A thousand? Ten thousand?
Except the amount of firepower necessary to destroy or even devastate a planet or space station is far more than needed to take out a starship, in fact I'm pretty sure there were way more threats to a starship than threats to a planet show in Star Trek, so you have better odds living on a planet or space station.