Allie had already figured it out the moment she was throwing books: she needed a place where no one would disturb her so she could test Aragog's venom.
And Lockhart was the best candidate to help her achieve this condition.
Allie first apologized with a bow to Professor McGonagall and Professor Snape, then pointed at Lockhart. "The truth is, I am extremely dissatisfied with this idiot's class. Since he says I was just joking and my spell was a mere trick... then he must have a way to solve it himself."
Chapter 84