Theory: the fields you mention, law and medicine, (historically and still) convey a higher social status on the member. There's also a relatively well trodden path through apprenticeship, successful practitioner, and eventual transition into other stable/respectable paths (politics, judiciary, hospital administration) as your career winds down.
Software engineering doesn't have that (yet?)