Based on the song ofthat the Sorting Hat itself sang one yearof the years, it seemed that in the beginning, each of the founding wizards had their own preference on who to accept (except Helga Hufflepuff, who would accept any witch or wizard who wanted to learn).
Excerpt: (from Harry Potter WikiWikia)
Said Slytherin, "We'll teach just those
Whose ancestry's purest."
Said Ravenclaw, "We'll teach those whose
Intelligence is surest."
Said Gryffindor, "We'll teach all those
With brave deeds to their name."
Said Hufflepuff, "I'll teach the lot
And treat them just the same."
The hat also recognized the inherent error in dividing the students:
And now the Sorting Hat is here
and you all know the score:
I sort you into Houses
because that is what I'm for.
But this year I'll go further,
listen closely to my song:
though condemned I am to split you
still I worry that it's wrong,
Though I must fulfill my duty
and must quarter every year
still I wonder whether sorting
may not bring the end I fear.