Your Handwriting is meant to communicate some message. Good or bad handwriting is about the way you convey the message.
If the writing is illegible then it means that you are unable or you do not wish to convey completely what is going on in your mind.
Illegible handwriting shows that the person is a fast thinker but he can also be manipuative.
About doctors and their Handwriting:
2 points need to be understood
1 Not all doctors have an illegible handwriting. Unfortunately doctors are one of the few professionals who give you something in writing i. e. Prescription. Do you know of any other professional or consulting service provider who writes something for you? So we are judging only doctors, because they write. We cannot make similar statements about chartered accountants or teachers etc. simply because they don't write for us.
2. As discussed above Those who have illegible handwriting are manipulative and don't want to reveal something clearly. Many doctors get commissions or practice in some wrong way or manipulate patients etc.
These 2 points can answer why we feel that most doctors have a bad Illegible handwriting.