Slytherin and Gryffindor were once best friends.
When Gryffindor told Slytherin that he believed any kid with magical powers should be invited into Hogwarts, Slytherin could not believe or accept it.
Slytherin believed Muggle-born wizards (Kids with human parents that had no magic) should not be allowed into Hogwarts because they weren't of pure blood.
This disagreement caused their friendship to end.
Slytherin started to curse the names of the other founders for siding with Gryffindor. What he didn't know was that he was saying these insults in Parselmouth, a language only spoken by snakes.
Hufflepuff overheard him one night and warned him about the dangers of speaking an unknown language while speaking such hateful words. She kept this a secret though because she didn't want to make the feud even worse.
When the first Muggle-born student was admitted into the school, Slytherin was angrier than he had ever been. He went into the restroom and yelled in Parselmouth. A door magically opened as he talked, revealing an underground lair.
After entering, he noticed a small Basilisk snake in the corner. The snake was gentle with him and quickly took affection towards Slytherin. Not wanting to know what the other founders might do, he kept this chamber a secret. He decided he was going to teach students of pure blood that were worthy of his brilliance.
Every time he went into the chamber, he noticed the more hatred he spoke out, the bigger the snake would get. He knew this could work to his advantage, making the Basilisk the protector of the chamber.