If you watch the episode "The Bonding", Picard and Troi have a conversation that pretty much answers any questions. Yes, it's a bit irresponsible to have families on a vessel that faces danger on a regular basis but, the galaxy is a dangerous place and no one can be totally safe at all times.