Tom was a Parselmouth - he wasn’t the true heir, he was a heir.
The reason that Tom Riddle was able to open the Chamber of Secrets was simply because he could speak Parseltongue. Harry was also able to open it, and so was Ginny (though they both had a connection with him at the time, Harry through the piece of soul in him, Ginny because she was being possessed by Tom Riddle). Even Ron, who had absolutely no connection with the Dark Lord and didn’t have the natural ability to speak Parseltongue, was able to open the Chamber by imitating what Harry said to open it.
“But how did you get in there?’ he asked, staring from the fangs to Ron. ‘You need to speak Parseltongue!’
‘He did!’ whispered Hermione. ‘Show him, Ron!’
Ron made a horrible, strangled hissing noise. ‘It’s what you did to open the locket,’ he told Harry apologetically. ‘I had to have a few goes to get it right, but,’ he shrugged modestly, ‘we got there in the end.”
- Harry Potter and the Deathly Hallows, Chapter 31 (The Battle of Hogwarts)
The J.K. Rowling Pottermore writing further indicates that the key to being able to open the Chamber of Secrets was indeed the ability to speak Parseltongue.
What is certain is that by the time Slytherin was forced out of the school by the other three founders, he had decided that henceforth, the Chamber he had built would be the lair of a monster that he alone – or his descendants – would be able to control: a Basilisk. Moreover, only a Parselmouth would be able to enter the Chamber. This, he knew, would keep out all three founders and every other member of staff.
In addition, it statess that the Chamber of Secrets had in fact been opened by others since Salazar Slytherin’s death and before Tom Riddle opened it.
There is clear evidence that the Chamber was opened more than once between the death of Slytherin and the entrance of Tom Riddle in the twentieth century. When first created, the Chamber was accessed through a concealed trapdoor and a series of magical tunnels.
This is further proof that Tom Riddle wasn’t the only true heir - descendants of Salazar Slytherin before him had indeed opened the Chamber of Secrets.
Tom believed he was the “true Heir” because he was arrogant.
Tom Riddle did believe himself (and Harry, once he found out about him) to be the only Parselmouth to attend Hogwarts after Salazar Slytherin.
“Because there are strange likenesses between us, Harry Potter. Even you must have noticed. Both half-bloods, orphans, raised by Muggles. Probably the only two Parselmouths to come to Hogwarts since the great Slytherin himself. We even look something alike …”
- Harry Potter and the Chamber of Secrets, Chapter 17 (The Heir of Slytherin)
However, this is less likely to be based in fact rather than Tom’s own grand thoughts about his importance, and relative lack of knowledge about his ancestors.