Among the trash and cast-offs in the Ewell yard, there's one spot of beauty.
"Against the fence, in a line, were six chipped-enamel slop jars holding brilliant red geraniums, cared for as tenderly as if they belonged to Miss Maudie Atkinson, had Miss Maudie deigned to permit a geranium on her premises. People said they were Mayella Ewell's." (17.64)
The geraniums suggest that Mayella desires to be better than her surroundings, to make something bright in her dull world, to aspire to higher things. But whatever Mayella's hopes and dreams are, she doesn't get a chance to express them to the reader; she appears only at Tom's trial. And there, she has to perform a role: the poor innocent white woman attacked by the evil black man, who must be protected by chivalrous white men.
Flower or Weed?
Mayella's a Ewell, and everyone knows what the Ewells are like: ugly, shiftless, and trashy—they even live by a dump. But when she takes the stand, she represents something else entirely: a flower of "Southern womanhood," an idea that itself is, according to Atticus, a "polite fiction" (15.39). But to justify sending an innocent man to death, the jury has to believe in her as a representative of "fragile" white women everyone:
A young girl walked to the witness stand. As she raised her hand and swore that the evidence she gave would be the truth, the whole truth, and nothing but the truth so help her God, she seemed somehow fragile-looking, but when she sat facing us in the witness chair she became what she was, a thick-bodied girl accustomed to strenuous labor. (18.2)
In order to convict Tom, the jury has to believe in, or at least pretend to believe in, the fragile, helpless girl who gets taken advantage of by Tom, rather than see her as a desperate, lonely teenager who actively desires him. It's not just ideals of women at stake, but also of men:
"I got somethin' to say an' then I ain't gonna say no more. That nigger yonder took advantage of me an' if you fine fancy gentlemen don't wanta do nothin' about it then you're all yellow stinkin' cowards, stinkin' cowards, the lot of you. Your fancy airs don't come to nothin'—your ma'amin' and Miss Mayellerin' don't come to nothin', Mr. Finch-" Then she burst into real tears.(18.167)
Mayella's comment suggests that for men to be big brave heroes, they have to believe that women are helpless timid victims in need of protection or avenging. According to this logic, proper men have to take Mayella's word over Tom's, or risk having their Man Licenses revoked, because Man has been defined as He Who Protects Women, not as He Who Listens Carefully To All The Evidence And Makes A Rational, Considered Judgment Based On The Facts.
Well, when you put it that way, it doesn't sound very manly, does it?
When Mayella accuses a black man, she's able to access the privileges of white Southern womanhood—namely, the chivalrous protection of men, no questions asked. If she had told Heck Tate that it was her father who beat her up (and raped her, apparently—"what her daddy did didn't count"), would she be in court testifying against him?
Well, maybe, but there certainly wouldn't be the huge audience that turns out to see Tom convicted. So why doesn't Mayella tell the truth about what happened? Well, she's probably afraid of her father. And she probably has another reason: guilt at doing an "unspeakable" thing, "kiss[ing] a black man" (20.45).
"She did something every child has done—she tried to put the evidence of her offense away from her. But in this case she was no child hiding stolen contraband: she struck out at her victim—of necessity she must put him away from her—he must be removed from her presence, from this world. She must destroy the evidence of her offense. What was the evidence of her offense? Tom Robinson, a human being." (20-43-44)
In comparing Mayella to a child, Atticus brings together the two opposite ideas of womanhood: yes, he's saying, she's naïve and weak (which is almost, but not quite, the same thing as innocent and helpless), but she also feels guilty because of her desire for Tom, which is causing her to commit the crime of perjury.
Atticus's version of her character seems reasonable based on what we've seen first-hand of her testimony in court (though of course, everything is filtered through Scout's perspective; see "Narrator Point of View" for more on this). And if we agree, then we can say Mayella is dealing with her own self-hatred for having a desire that society tells her is wrong. By destroying Tom, the desire is destroyed.
Or maybe, given that she is a Ewell, she doesn't see anything wrong with what she did—she's just sorry she got caught, she's now trying to do damage control with her father by saying whatever he wants her to say. In any case, after Tom's conviction Mayella goes back to her flowers on the trash heap, and Maycomb stops caring about her. She never reappears in the novel, but perhaps her father's death will give her the opportunity to make good on the promise of geraniums.