Ginny Weasley was responsible for the opening of the chamber of secrets, (she was possessed by Riddle's diary). As Voldemort said, one has called the Basilisk otherwise that creature wouldn't come out. So Ginny has to call him out from the chamber. In doing so why did the Basilisk did not kill her? Was it because she was possessed by Voldemort?
Tom Riddle had preserved his soul in his diary (his first horcrux) which was a bit like an agony aunt where Ginny shared all of her secrets. Tom made Ginny kill chickens, write on the wall with blood and petrify students, but Ginny did not know she was doing all of this until she finally realised because she had chicken feathers and blood (that she thought was paint) all over her clothes. Tom was only a memory and therefore was only there because of the diary and if the diary was demolished, so would Tom. He was taking her life force out of her body which was making Tom stronger and Ginny weaker which would kill her eventually anyway so there was no need for the Basilisk to kill Ginny.