But if it's not ok to become a soldier if you have kids, that severely limits who can be a soldier. (For example, many soldiers get married and start families during their careers as soldiers. Should they instantly get discharged if that happens? Taken off all possibly dangerous duties?) That doesn't seem like a good idea for society as a whole, since it makes being a soldier a much less attractive career, and any society needs soldiers to defend it.
The argument with cave diving is at least somewhat stronger, since I don't see any pressing need for society as a whole to have a particular number of cave divers, or for cave diving to be an attractive career.