Rambam, Moreh haNevuchim 3:37
ואמרו בפירוש כל שיש בו משום רפואה אין בו משום דרכי האמורי, רוצים בזה שכל מה שיגזרהו העיון הטבעי הוא מותר וזולתו אסור... ואל יקשה עליך מה שהתירו מהם במסמר הצלוב ושן השועל, כי הדברים ההם בזמן ההוא היו חושבים בהן שהוציא אותם הנסיון והיו משום רפואה
They said explicitly that medicinal treatments are not subject to "Emorite ways", meaning that anything mandated by natural studies is permitted, and anything else is prohibited… Do not be troubled by the Sages' permission of a tzaluv's nail or a fox's tooth, for in their day they thought these were medical products of testing...Meiri Shabbat 67a
וזה שכתבו רבותינו ע"ה הרבה מהם בסוגיא זו ובמקומות אחרים הם נעזרו בדבר זה בצירוף בשני דברים הא' שלא היה שם דבר כדאי להטעות אלא הבלים המוניים וכזבי הנשים כמו שתראה ברובם שהיו מיחסים אותם על שם הנשים המיניקות והמגדלות את הילדים ומגדלות אותם בלימוד הבליהם והוא אמרם אמרה לי אם וכו':
והשני שמצד שהיו ההמון באותו זמן בטוח באותם הענינים היה טבעם מתחזק ונמצא מצד ההרגל עזר טבעי בהם
The fact that our Sages of blessed memory recorded many of these practices in this passage and other passages was a result of two factors:והשני שמצד שהיו ההמון באותו זמן בטוח באותם הענינים היה טבעם מתחזק ונמצא מצד ההרגל עזר טבעי בהם
First: These practices did not include anything which could mis-lead someone [into idolatry – MT]; these were only the empty practices of the masses and the follies of women, as you can see that the majority of them were ascribed to nursemaids and nannies of children, who raised them and inculcated in them these empty practices. Thus the sages said, "My mother [or nursemaid – MT] told me."
Second: Because the masses believed in these practices in those days, they were strengthened, and as a result of habituation they found natural help in them.
Vilna Gaon to Yoreh Deah 179:13
כל הבאים אחריו חלקו עליו שהרי הרבה לחשים נאמרו בגמרא והוא נמשך אחר הפלוסופיא ולכן כ' שכשפים ושמות ולחשים ושדים וקמיעות הכל הוא שקר אבל כבר הכו אותן על קדקדו שהרי מצינו הרבה מעשיות בגמ' ע"פ שמות וכשפים אמרה איהי מלתא ואסרתה לארבא אמרו כו' (שבת פ"א ב' חולין ק"ה ב') ובספ"ד מיתות ובירושלמי שם עובדא דר"א ור"י ובן בתירה וכן ר"ח ור"א דאיברו עיגלא תילתא ור' יהושע דאמר שם ואוקמיה בין שמיא לארעא (בכורות ח' ב') וכן אבישי בן צרויה (סנהדרין צ"ה א') והרבה כיוצא ואמרו (בספ"ד מיתות חולין ז' ב') למה נקרא שמן כשפים כו' והתורה העידה ויהיו תנינים וע' זוהר שם וכן קמיעין בהרבה מקומות ולחשים רבו מלספר. והפלסופיא הטתו ברוב לקחה לפרש הגמרא הכל בדרך הלציי ולעקור אותם מפשטן וח"ו איני מאמין בהם ולא מהם ולא מהמונם אלא כל הדברים הם כפשטן אלא שיש בהם פנימיות לא פנימיות של בעלי הפלוסופיא שהם חצוניות אלא של בעלי האמת:
All who came after him [Rambam - MT] disagreed with him, for many incantations were mentioned in the gemara. He was drawn after philosophy, and so he wrote that sorcery, Names, incantations, demons and amulets are lies, but they have already struck him upon his skull for we have found many anecdotes in the Talmud with Names and sorcery. Examples are in Shabbat 81b, Chullin 105b, the end of the seventh chapter in Sanhedrin…Philosophy, with its many lessons, tricked him into explaining all of these talmudic passages in the manner of mockery, uprooting them from their simple explanation… All of these are in accord with their simple meanings, but they have inner meanings. Not the inner meanings of the philosophers, which are actually external, but of the people of truth.
R' Neriah Gutel, Hishtanut haTevaim baHalachah, pg. 179 citing R' Avraham ben haRambam (and see his footnote 427 there)
לא נתחייב מפני גודל מעלת חכמי התלמוד ותבונתם לשלימות תכונתם בפירוש התורה ובדקדוקיה ויושר אמריה בביאור כלליה ופרטיה שנטען להם ונעמיד דעתם בכל אמריהם ברפואות ובחכמת הטבע והתכונה ולהאמין אותם כאשר נאמין אותם בפירוש התורה שתכלית חכמתה בידם ולהם נמסרה להורותם לבני אדם
We are not obligated, due to the great stature of the Sages of the Talmud, and their understanding and complete comprehension of the explanation of Torah and its fine points and its righteous sayings in explaining its principles and specifics, to therefore argue on their behalf and support their views in all of their statements about medicines and the study of nature and mathematics, and to believe them in this as we believe them in explaining the Torah, in which the entirety of its wisdom is in their hands, and was given to them to teach to humanity.