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 was draining her life force (for lack of better term) so while Ginny was getting weaker, he was getting stronger. He needed her in his plan so Basilisk shouldn't kill her on his orders. He also didn't kill her with its gaze, because Ginny had her eyes closed (being in coma and all).
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.