Here's why:
* Tom Riddle (Lord Voldemort) opened the Chamber of Secrets the first time. This was when he was a student at Hogwarts, and he used the diary to control Ginny Weasley and make her open the Chamber.
* Hagrid was falsely accused of opening the Chamber. This was due to the diary's influence on Tom Riddle, who framed Hagrid. He was expelled and sent to Azkaban.
The Chamber of Secrets was opened twice in the Harry Potter series:
1. First time: By Tom Riddle in the 1940s.
2. Second time: By Ginny Weasley under the influence of Tom Riddle's diary in 1992-1993.