Ties are pretty mobile and can easily brush against a patient or instrument, especially if the doctor is leaning forward. Unlike other clothing, they are also rarely washed and they seem less essential than, say, pants.
A few studies have isolated MRSA and other nosocomial nasties from ties. However, it's unclear how much of an actual risk this is, and ties are thought to convey some sense of professionalism that makes the patients take medical advice more seriously and...tradition (ugh). This bit from The Lancet has some back-and-forth about it.
https://www.thelancet.com/pdfs/journals/lancet/PIIS014067360...