Mathilda resents the doctor coming to see her as it will mean that her parents will find out that she's suffering from diphtheria, a potentially fatal illness. Children often keep secrets from their parents, and Mathilda's diphtheria is hers. So when the doctor comes to examine her, she immediately refuses to play ball. The doctor responds by forcing Mathilda's mouth open with a spoon in order to examine her throat, much to the girl's anger.
Under the circumstances, the doctor had no choice. As we've already seen, diphtheria is a potentially deadly illness, and it is important for the good of Mathilda's health that a proper examination of her throat takes place. But Mathilda's too young to understand. In the figure of the doctor she sees not a healer, someone who wants to help her, but a complete stranger hell-bent on stealing a secret from her.
In writing the story, Williams most probably wanted to explore the theme of submission to power. To make matters more complex and therefore more interesting, it's notable that the doctor actually derives a fair measure of enjoyment from forcing open the young girl's mouth. The suggestion is that he isn't simply doing this for Mathilda's good but for his own pleasure. This could well be said to apply to most people who exercise power over others.