I’m guessing here because I’ve not heard anyone use this term before. Back in the 19th century, American women were not allowed to get a higher education and when they finally were allowed, they still could not get jobs as doctors, lawyers, etc.
I’m guessing “lay doctor” is in reference to someone who did not have the medical education and was self-taught but worked in an unofficial capacity such as a midwife.