Why does Atticus ask whether anyone has called a doctor and why is this important?
There are several reasons Atticus asks about the doctor. First, Mayella's father has testified that he interrupted Tom while Tom was raping Mayella. A doctor could provide physical evidence of such a rape.
Also, the father's failure to call a doctor demonstrates forcefully that his primary interest in accusing Tom is to protect his family's reputation, such as it is, rather than concern for Mayella's welfare. This is in sharp contrast to how Atticus treats Mayella when he questions her; he shows genuine tenderness toward her. He understands how difficult her life is, and why she has been forced into the situation she is in.
In order to assure that she would be alone with Tom, Mayella, who is usually responsible for her many younger siblings, carefully saves money for many months so she can send them all to buy ice cream.
Calling a doctor would demonstrate that Mr. Ewell is concerned about his daughter's welfare. Mr. Ewell can't be bothered because, as far as he is concerned, she "deserved it". Additionally, the book is set during the Depression. Calling a doctor would have been expensive - a cost Mr. Ewell would avoid considering he does not value his daughter's life, i.e., she isn't "worth it". Of course, Mr. Ewell commits these crimes against Mayella, and would not have wanted to have been implicated.
In order to have Tom to herself, Mayella has saved change for weeks to "treat" her brothers and sisters to ice cream by sending them into town to buy it.
If a doctor had been called to examine Mayella, there would have been a witness and possible physical evidence that she had been attacked. It's important because it helps to prove that she's lying about having been raped by Tom. She was embarrassed that she was rejected and knows that if she accuses a black man, it's likely she'll be believed. She gets rid of the children by saving up enough money for them all to be able to go and but themselves some ice cream.