Judges and officers shall you appoint in all your cities which Hashem your G-d gives you for your tribes; and they shall judge the people with righteous judgment. (Devarim 16:18)
A Dayan (rabbinical judge) must possess many qualities in order to be eligible for the position. Aside from erudition in matters of Halacha and familiarity with the policies of Beis Din, there are a number of other traits enumerated by the Gemara (Sanhedrin 17a):
Said R’ Yochanan: One only appoints to the Sanhedrin people who are tall, wise, attractive, of suitable age, familiar with sorcery (Kishuf), and fluent in all seventy languages – so that the Sanhedrin needn’t hear [the testimony of witnesses] through an interpreter.
According to Rashi, a Dayan must be tall and attractive so that his imposing appearance will deter the litigants from lying to the court. The need for wisdom is self-evident. Age brings maturity, life experience, and respect (though an extremely elderly Dayan is disqualified – ibid. 36b). Knowledge of Kishuf allows him to interrogate necromancers (Rashi) and distinguish between actions that are Kishuf and those that are not. A Dayan must be a polyglot so that he will understand testimony in any language, as the Gemara explained.
The Rambam (Hilchos Sanhedrin 2:1) elaborates upon these traits and adds several more:
One only appoints to the Sanhedrin (whether a minor court or the supreme court), wise and astute men, extraordinary in Torah wisdom, possessors of vast knowledge, somewhat familiar with other wisdom such as medical knowledge, mathematics, calculations of the seasons, constellations, astrology, the manner of necromancers and sorcerers, idolatrous superstitions, and other similar matters, so that they are able to judge them.
The Mefarshim struggle to explain the additions of the Rambam to the list of traits recorded in the Gemara. In particular, as the Radvaz and Ramach (cited by the Kesef Mishna) note, an understanding of medical matters would surely appear to be unnecessary for a Dayan!
The Radvaz suggests that it is important for a Dayan to be familiar with genuine medical treatment and medications (and be capable of distinguishing them from unproven remedies) so that he may approve their use, even on Shabbos. Alternatively, in a case where a person is fed a concoction and subsequently dies, the Dayan must be capable of determining whether it was in fact poisonous.
The haMeir laAretz suggests a different answer. By Torah law, a physician may only practice medicine if he receives approval from the Beis Din. If he has their approval, he will be exempt if he errs and causes harm to a patient (Tosefta Bava Kama 6, Tur & Shulchan Aruch Y.D. 336:1). Therefore, it is imperative that the Beis Din have the requisite medical knowledge so that they are capable of issuing a license to practice medicine.
[We should note that modern Poskim agree that medical licenses issued by the relevant authorities (e.g. state medical boards) are considered to be an approval by Beis Din.]
Many other commentators offer explanations that are similar to that of the Radvaz. The Mirkeves haMishna contends that medical knowledge is necessary for a Dayan to rule on all matters of Pikuach Nefesh, not just to ratify the desecration of Shabbos (as mentioned by the Radvaz), but also to permit a sick person to eat on Yom Kippur.
The Eitz haChaim suggests another answer. The Rambam (Hilchos Eidus 20:7) rules that if witnesses testified falsely that somebody killed a Treifa (a person with a terminal illness or injury who is not expected to live out the year) and they become Eidim Zomemim, they are not put to death. It follows that it is imperative for Dayanim to know whether a person is truly a Treifa or not; else they cannot rule whether a person is liable to the death penalty when he kills a sick person.
Others propose an answer based on another ruling of the Rambam in Hilchos Rotzeach u’Shemiras haNefesh (4:3):
[In the case of] a person who strikes his fellowman, with a stone or with his fist or similar [implement], we evaluate him [i.e. we assess the condition of the victim]. If he is evaluated and expected to survive [the blow], the assailant pays the five payments [to the victim] and is exempt from further punishment. Even if the person who was assaulted then becomes ill due to the blow and his condition deteriorates to the point of death, the assailant is exempt [as he was originally evaluated and expected to survive]. But if they originally judged that he would die, the assailant is immediately incarcerated and we wait to see the outcome. If he dies, the assailant is put to death. If he recovers completely and walks about on the streets like other healthy people, the assailant pays the five payments and is exempt from further punishment.
The assessment (made by a Beis Din) of whether an assault victim is likely to survive or to die requires a great deal of medical acumen.
The Kuzari (2:64) discusses how it is vitally important to study other fields of wisdom in order to understand various facets of the Torah. He explains the value in understanding the biological makeup of humans and of animals and other aspects of medical knowledge, such as understanding Treifos, blemishes that would disqualify Kohanim from serving in the Beis haMikdash, blemishes that disqualify animals as sacrifices, and the various emissions of a Zav, Zavah or Nidah.
However, a number of difficulties remain. Firstly, why does a Dayan need to be acquainted with medical knowledge himself? Why can’t the Beis Din appoint an expert physician to serve as a resource when they require medical information?
Furthermore, the Rambam writes clearly that a Dayan need only be “somewhat familiar” with medical knowledge. Clearly he needn’t be as knowledgeable as a trained and experienced doctor. Yet, if he is to be capable of ruling on matters of Pikuach Nefesh, Treifos, or mortal injuries, or of awarding licenses to practice medicine (as the respective Mefarshim explain), he surely needs more than just a cursory understanding of medicine.
Indeed, a partial understanding of medical matters is absolutely not adequate to rule on these issues, and a Dayan will certainly need to consult with medical professionals. If he doesn’t, he is likely to err and will undoubtedly rule incorrectly, which is itself a great sin. Nevertheless, the Rambam rules that he must have sufficient understanding of these matters, else he cannot rely on the opinions of medical professionals. This is because he must be capable of discerning whether they are truly offering expert advice and recommendations.
This conclusion was also made by R’ Chaim David HaLevi in his Sefer Devar haMishpat. He notes that in our time, Rabbanim and Poskim are frequently faced with complicated new questions that often require the input of professionals for clarification. However, Rabbanim cannot rely solely upon experts to offer their opinions, especially as contradictory positions may exist among experts. It is unfortunately all too common for incorrect rulings to be issued based on erroneous understanding of the question or deficient knowledge about the issue. He therefore concludes that it is not only ideal but vital that Rabbanim understand other fields of knowledge in order to rule on such matters.
Though R’ HaLevi chiefly refers to “complicated new questions” that arise, the underlying theme of his argument is clear: the Torah places the responsibility upon a Dayan to ensure that he can issue a correct ruling by thoroughly understanding the matters at hand. According to the Rambam, this obligates him to study medicine sufficiently in order that he will be able to intelligently discuss these matters with medical professionals when the need arises.
 This includes any Beis Din, not just the Sanhedrin haGadol (Rambam, Hilchos Sanhedrin 2).
 The Ramach also questions why a Dayan would need to understand mathematics or the constellations. The Kesef Mishna suggests an answer to this but is unable to explain why knowledge of medicine is important.
 R’ Meir b. Betzalel Soloveichik of Slutsk (published 5671)
 R’ Chaim Abulafia (1660-1744), Rav of Tzefas, Izmir (Turkey), and T’veria.
 If a second pair of witnesses claim that the original witnesses were with them in a different location at the time of the incident they testified, the false witnesses (i.e. the original pair) would receive the punishment they had tried to inflict upon the person with their testimony (“Ka’asher Zomam”), which would be the death penalty in this case.
 This refers to the five payments made for damages: Nezek (damage), Sheves (lost wages), Tza’ar (pain and suffering), Ripui (medical costs), and Boshes (shame and embarrassment).