Mayella's reaction to breaking the code and the guilt it has caused her led her to strike out at her victim. She turned the tables in order to deflect the guilt from herself and place it on Tom.
"...her subsequent reaction is something that all of us have known at one time or another. 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."