The original Star Trek series and Star Trek movies basically portrayed the Star Fleet culture aboard ship as similar to the U.S. Navy. The culture is predominantly male but women are allowed on most ships, especially in "support" roles such as science, medicine and communication. Despite a certain level of romance aboard ship through TOS, though, wives and children are not found on the original USS Enterprise, and its complement is only about 400 people as a result.
In Star Trek: the Next Generation, Deep Space 9, and the new Star Trek movie, ships of the fleet are seen carrying a substantial complement of youth and non-Starfleet types. The Enterprise-D, in fact, has a complement of over a thousand, many of those being families and children of serving Starfleet personnel (which had to be evacuated in Generations before separating the saucer). The U.S.S. Kelvin in the new Star Trek was carrying James Kirk's mother (apparently a noncombatant), who gives birth to him on a shuttlecraft as his father assumes command of the Kelvin and holds off the Romulan ship that attacked them.
Why the difference, in-universe? Starships are dangerous places, as the new Star Trek demonstrated, and even if the personnel would be in space for months or even years at a time on rotation, and even if the ship's stated mission is exploration, it would seem foolish to risk the lives of non-combatant women and children in a battle with a Romulan cruiser, or by being on the wrong end of a scientific experiment like the Soliton Wave, or encountering the wrong spatial anomaly like Tyken's rift. I understand the presence of family aboard DS9, which if nothing else is a stone's throw from a relatively safe haven on Bajor, but a ship intended "to boldly go where no one has gone before" has to be crewed with the understanding that it may not come back.