Because the time frame that TNG takes place in. It was a peaceful era and the Galaxy Class ship was designed for prolonged exploration and ambassador missions. Due to the long periods in space the Federation designed the ship to accommodate families of the Starfleet officers. That’s also why the ship could separate, the battle bridge could go into combat while the civilians stayed behind in the saucer section. With these long voyages and family aboard they thought it was important to include mental health being an importance, so important that Troi was a bridge officer.
Voyager was a smaller ship made purely for scientific research and wasn’t supposed to be gone for so long. Also, after the discovery of the Borg, the Federation changed their ship designs to have more combat in mind.
That’s not the message to take from this.