Im sorry those people died but Doctor/patient confidentiality is one of the cornerstones of freedom. "Freedoms" that "millions" died for so that we can have.
To be honest...
Almost any serious (health/live etc) insurance require you to allow access to medical records... We allow access to health data to many organization otherwise we wouldn't get services.
AFAIK, pilots MUST report any health issues to employer (or not be a pilot keeping his private stuff to himself - his choice) - so I don't think doctor/patient confidentiality works there. A pilot by selecting the job virtually removes the confidentiality at least between doctor, patient and employer.
Doctors could if not should report the health issues to pilot employer or at least pass the information to required authorities - it isn't question of rights, it is more question of the legal mechanism that would allow the physician to report problems without fear of being sued or loosing his license.
For example, in California physicians are required to report some health states to DMV as drivers with such a conditions may threaten the public. The right for privacy is not absolute as a public has also a right for safety.
I don't see same rues can't or shouldn't be applied to aviation safety.