Among my family and friends are a radiologist, emergency room physician, nurse anesthetist, and a (multiple) registered nurses. This is just my own observation, but they appear to have much greater options to scale back on work for a half decade while they have kids than the software developers I know, without severely compromising their career path when they re-enter full time at a later date. And all these career paths pay, at the median in San Francisco, more than the median for a software developer in San Francisco.
With the exception of radiology, telecommuting, which may people consider to be a critical element of a "flexible" job, is not a big part of most health care jobs. However, jobs like registered nurse, pharmacist, nurse anesthetist, and emergency room physician, may offer more flexibility where it counts most, especially to people who want to pursue meaningful careers but recognize that a period of life, probably when they have small children at home, will require scaling back for an extended period.