Interestingly, the three careers you listed are protected by strict professional credentialing systems that do not exists for programmers, and professionals in law and medicine enjoy a social prestige that is certainly attractive to a group of people who might not innately enjoy the work itself.