In a nutshell, Tom Robinson cannot accuse Mayella Ewell of lying because he's a black man and she's a white woman in the Jim Crow South.
After the Civil War, whites made laws intended to rob the newly-freed blacks of their rights and keep them subservient. Among other things, they created "white-only" public places, banning them from swimming pools and restaurants, etc. The Ku Klux Klan rose to power for the first time, and among its purposes was to protect the innocence of white women (all it took for a black man to be summarily lynched was an accusation of him "outraging"--raping--a white woman). Lynchings were common, and blacks, to a large extent, lived in terror of the whims of upset whites. Laws did nothing to protect blacks from being lynched on a whim (anti-lynching bills came before Congress several times and were never passed). Blacks were also fairly quickly disenfranchised, and any who seemed to "think he was as good as a white man" would be destroyed.
Because of this atmosphere, which was nationwide but prevalent in the South, Tom knew better than to even suggest that a white woman was lying--even in a court of law. Such a comment would ensure his immediate (painful) death.