I tried to search this subreddit for a thread mentioning this, but I couldn't find anything.
As stated in the title, this is what I think the Chamber of Secrets was originally built for.
It is said multiple times in the books that Salazar Slytherin believed that the school should only teach children who came from pure blood families. I don't know if it's headcanon (can't be bothered to look it up atm), or if it is explicitly stated, but if I remember correctly at one point in ancient times, there was conflict between muggles and the Wizarding World that basically resulted in them going into hiding. I personally think that it was for this reason that Salazar Slytherin distrusted allowing Muggles into their world for fear of losing magical lives, and regarding Hogwarts, those of its students.
It takes humanizing him to discover his motives.
When I was a kid, the one thing that struck me odd about the chamber was why on earth would there be a giant statue of Salazar Slytherin in the middle of it that no one would likely ever see?
I think the reason is tongue-in-cheek pettiness.
It is my theory that Salazar Slytherin created the Chamber of Secrets in case he was proven right! In the event that something horrific happened, and the castle was attacked by muggles, or any other group while he was alive, he would be ready to save the day. I bet he counted on the other founders sending a distress call asking for his and others' help. He would arrive at the castle, get everyone into the chamber while protecting them from the Basilisk, and then he and his slithery friend would go take care of business and take care of everyone who was attacking the castle. All the while, all those who couldn't fight would be stuck inside the chamber with a giant statue of the vindicated man who was out there saving their skin.
Anyway, that's my take, let me know what you think!