In "To Kill a Mockingbird" why would Bob Ewell rape his daughter? Just because he didn't like Tom doesn't mean that he had to pick on a black man.
If you look closely at Tom's testimony in chapter 19, there is no indication that Bob Ewell raped his daughter, and hopefully he didn't. Tom describes how after Mayella kissed him, he told her he had to leave, and then she blocked the door so that he couldn't, at which point he "had to push her." As he pushed her out of the way, he said, "Lemme pass," and that is when Bob Ewell "hollered through th' window," at Mayella, saying, "you goddamn whore, I'll kill ya." Then, Tom got out of there as fast as he could. Based on Mayella's injuries, it indicates that Bob throttled her around the neck and beat her up quite a bit, but there was no evidence to suggest that he raped her. He was probably incensed that he had caught her hitting on a black man, and in a fit of rage, nearly choked and beat her to death for it. To cover his beating of his daughter, and the shame he feels for her having kissed and come onto a black man, Bob invents the story of Tom raping her. That way the bruised on Mayella can be blamed on Tom, and his indignation at Mayell's indiscretion can be turned, and twisted in his mind, so that he can feel that it was Tom that came on to her.
Bob's sense of dignity and pride is a bit messed up; he is the lowest of the low when it comes to types of men, but somehow he feels himself above a hard-working black man with a family that he actually takes care of. It isn't that he personally dislikes Tom and so pegs him for the "crime", it is that he doesn't like black people as a whole. He's a racist, and he knows that if he accuses a black man of rape, he will come off completely vindicated of any wrongdoing. He understands the racism and fear that exists in his community, and Tom is the perfect scapegoat. So, that is why Tom is used as he is.