In "To Kill a Mockingbird", why did Mayella first tempt Tom Robinson, then bring charges against him?
Based on information Bob, Mayella and Tom give us, we can assume a few things.
First, Tom did not attack or rape Mayella. She attacked or tempted him.
Bob saw that through the window of the shack and beat Mayella for it.
In order to cover for his own transgression, and to make himself look like a hero in Maybcomb for taking down a black man, Bob brought the trial to court.
Mayelle went along with it and lied, we can assume, because she was afraid of what her father might do if she stood up to him.
Because of Mayella's lonely existence, she was eager for anyone to pay attention to her and be nice to her. Tom Robinson showed her kindness and treated her with respect, which is probably what made her tempt him. When her father saw this, he beat her brusquely. The lie blaming Tom Robinson was constructed to explain her injuries without implicating Bob. In a society as racist as Maycomb County, Tom was one of the few people he could blame without needing a more in depth investigation.