There are really two reasons that Scout gets to stay. First of all, she really doesn't understand what "rape" is. Atticus gave her a point blank definition, but she doesn't understand what it is or what it is about. (she's too young to understand sex) Second, they were in the balcony the whole time (with Reverend Sykes and the black community) and they saw all of the witnesses testify before they were caught. So since they'd already been through it all, Atticus let them come back after some dinner to see the verdict.