The Sorting hat sorts you through a mix of your potential, your dominant trait at the time and your own preference.
There are plenty of examples of characters who lean one way or the other in this. Hermione would easily do as a Ravenclaw, but given that she has both intelligence and bravery, the fact that she values bravery more probably tipped the scales for her.
"Me!" said Hermione. "Books! And cleverness! There are more important
things -- friendship and bravery and -- oh Harry -- be careful!"
Neville, on the other hand, shows little actual bravery at first - but we can infer he wishes to be brave, like his Grandmother. Of course, as early as the end of book 1 Neville has begun to show bravery, never mind by book 7 when he's
a fucking badass shouting defiance to Voldemort's face.
"It takes a great deal of bravery to stand up to our enemies, but just
as much to stand up to our friends. I therefore award ten points to
Mr. Neville Longbottom."
The Hat seems to have valued his potential here, and possibly his (familial) preference.
And so we must consider young Snape. Let's go through his potential, dominant trait and preference.
Potential - Snape is cunning, resourceful and intelligent. Very gifted in practical magic. He also demonstrates incredible bravery later on in life. His potential leaves him open to Ravenclaw, Griffindor and Slytherin.
Dominant trait - Young Snape is dominated by his ambition and thirst for power, implied to be a direct result of his miserable home life with an abusive (Muggle) father.
...suddenly Harry’s mind was teeming with memories that were not his:
a hook-nosed man was shouting at a cowering woman, while a small
dark-haired boy cried in a corner... a greasy-haired teenager sat
alone in a dark bedroom, pointing his wand at the ceiling, shooting
down flies... a girl was laughing as a scrawny boy tried to mount a
bucking broomstick -
"Oh yes, they’re arguing," said Snape. He picked up a fistful of
leaves and began tearing them apart, apparently unaware of what he was
doing. "But it won’t be that long and I’ll be gone."
It is true that Snape also shows some bravery in dealing with the Marauders, but this is a very blunt sort of bravery - note that he does not have the same fortitude when dealing with Lily and his Death Eater friends. He attempts to straddle both worlds for a while, unable to either face the evil of the Death Eaters, nor accept their creed entirely. Some moral development is still needed here. Based on this, his dominant trait clearly points him towards Slytherin.
Preference - Snape himself makes his preference perfectly clear on the Hogwarts express, when talking to Lily.
"You’d better be in Slytherin," said Snape, encouraged that she had
brightened a little.
And when Griffindor is brought up by
that prick James
Snape made a small, disparaging noise.
James turned on him. "Got a
problem with that?"
"No," said Snape, though his slight sneer said
otherwise. "If you’d rather be brawny than brainy-"
Beyond Snapes own statements, his actions up to this points indicate he's invested in Slytherin and it's affinity with the Dark Arts.
"Snape knew more curses when he arrived at school than half the kids
in the seventh year and he was part of a gang of Slytherins who nearly
all turned out to be Death Eaters."
Thus, his personal preference is clearly for Slytherin.
The basic conclusion here is that young Snape had the potential, the traits of, and valued Slytherin far more than Griffindor. The Sorting Hat made the correct choice for the young man. Of course, as we see in the books, Snape would grow into a far braver man than he'd have thought possible. All in all this can be summed up by the conversation between Snape and Dumbledore during the Yule Ball.
"Karkaroff’s Mark is becoming darker too. He is panicking, he fears
retribution; you know how much help he gave the Ministry after the
Dark Lord fell."
Snape looked sideways at Dumbledore’s crooked-nosed
profile. "Karkaroff intends to flee if the Mark burns."
said Dumbledore softly, as Fleur Delacour and Roger Davies came
giggling in from the grounds. "And are you tempted to join him?"
said Snape, his black eyes on Fleur’s and Roger’s retreating figures.
"I am not such a coward."
"No," agreed Dumbledore. "You are a braver
man by far than Igor Karkaroff. You know, I sometimes think we Sort