We do not know why Mayella Ewell really invited Tom Robinson into her house. But the speculation is (what Atticus claims in court) that she had a very lonely life and she wanted to seduce Tom. When Tom doesn't want to sleep with her, she claims he raped her.
The fact that Tom is right handed is important because all the bruises he supposedly inflicted on her are on the right side of her face. A right handed man would have hit the left side of her face.
Her father is left handed...
Mayella Ewell is a lonely girl who is deprived of love in a home filled with children, poverty, and a disgraceful upbringing. Mayella probably had little opportunity to get out and meet any boys her age. Atticus makes it a point to bring it up in court that she did not have social relationships with friends.
Mayella probably had some desires and she wanted to test her feelings. Tom was a gullible victim, but he was also a nice person which she seemed to already know. When Mayella invited him into her house she may not have exactly expected her own behavior to emerge, but was impulsive.
This is only speculation as the book does not really explain her true motives.