Atticus feels sorry for Mayella Ewell because she is just a lonely young girl caught in a situation that got out of her control.
Atticus is aware that Mayella is not an evil person. He knows from talking to Tom Robinson that she lives a lonely life. She does not go to school, she has no friends, and she has to take care of her multitude of brothers and sisters all day.
Tom Robinson was one of the only people that Mayella had friendly contact with. He helped her with chores, and soon she was finding chores to ask him to help her with. He did not ask for money. He was just trying to help. He was married, and she was young. He never thought she had romantic ideas for him.
She did something that in our society is unspeakable: she kissed a black man. Not an old Uncle, but a strong young Negro man. No code mattered to her before she broke it, but it came crashing down on her afterwards. (ch 20)
Atticus’s words demonstrate that he really does feel sorry for Mayella. He does not blame her for accusing his client. He understands and empathizes with her. As he explains to the jury, that does not mean that he believes her.
I have nothing but pity in my heart for the chief witness for the state, but my pity does not extend so far as to her putting a man's life at stake, which she has done in an effort to get rid of her own guilt. (ch 20)
Unfortunately, Tom Robinson's real crime was feeling sorry for a white woman. The jury could not take his word over hers. They convict him, even though Atticus has proven that no crime was committed.