Why was Voldemort the heir to Slytherin

Legacy of Slytherin

In his 5th grade, Tom Riddle finds out that he is the last descendant of Salazar Slytherin and thus the one Legacy of Slytherin (in the original: Heir of Slytherin).
Tom Riddle cites his famous ancestors in his plan to rid Hogwarts of witches and wizards of Muggle descent. Slytherin himself propagated this, but did not enforce it himself, but quarreled about it with the three other school founders.

Tom begins to forcibly carry out the Slytherin legacy: he manages to find and open the Chamber of Secrets that Slytherin hid deep under the lake at Hogwarts before he left school. A basilisk, a murderous giant snake that can get very old, has lived locked in that chamber since then. Only someone who, like Slytherin himself, speaks Parseltongue can open the chamber and command the snake.

When the student Tom opens the chamber and lets the basilisk loose on his classmates, he is only known as the "heir of Slytherin" and can therefore also direct suspicion to Rubeus Hagrid when the threat from his classmates threatens to harm him. The fifth grader therefore included the monster again in the summer of 1943.
It was not until fifty years later, during Harry's second school year 1992/93, that the "heir of Slytherin" reappeared and was once again able to incite the basilisk on students of Muggle-born origin.