short answer:
Because (like Harry) Snape was supposed to die by Voldemort's hand (all part of Dumbledore's plan)
Both Harry and Snape must only find out about their inevitable deaths at the last moment, because both Harry and Snape might not have the strength to accept their impending deaths.
deathly hollows chapter the prince's tale
“Harry must not know, not until the last moment, not until it
is necessary, otherwise how could he have the strength to do what
must be done?”
Long answer (and a vindication for Snape)
Note that there is nothing in canon about what was inside Snape's mind in the Shrieking
Shack.This will be speculation of Snape's thoughts based on the sequence of events in the shack and Snape's memories in the Pensieve
- Snape was looking at the enchanted cage around Nagini when he realized that Dumbledore's plan has come true - Voldemort was now protecting Nagini. - Snape must now tell Harry that he is also a horcrux.
deathly hollows chapter the prince's tale (scene where Harry was looking at Snape's memories in the Pensieve)
There will come a time when Lord Voldemort will seem
to fear for the life of his snake.”
“For Nagini?” Snape looked astonished.
“Precisely. If there comes a time when Lord Voldemort stops sending
that snake forth to do his bidding, but keeps it safe beside him
under magical protection, then, I think, it will be safe to tell Harry.”
deathly Hollows chapter the elder wand (scene where Harry was spying on Snape and Voldemort)
And for a moment Harry saw Snape’s profile: His eyes were fixed
upon the coiling snake in its enchanted cage.
“No, my Lord, but I beg you will let me return. Let me find
Potter.”
- Then Voldemort started talking about how the Elder wand was not doing extraordinary magic. Hinting that the wand does not recognize him as it's master.
deathly hollows chapter the elder wand
“I sought a third wand, Severus. The Elder Wand, the Wand of
Destiny, the Deathstick. I took it from its previous master. I took it
from the grave of Albus Dumbledore.”
And now Snape looked at Voldemort, and Snape’s face was like a
death mask. It was marble white and so still that when he spoke, it
was a shock to see that anyone lived behind the blank eyes...
...“Perhaps you already know it? You are a clever man, after all,
Severus. You have been a good and faithful servant, and I regret
what must happen.”
“My Lord —”
“The Elder Wand cannot serve me properly, Severus, because I
am not its true master. The Elder Wand belongs to the wizard who
killed its last owner.
- Then and only then, did Snape realize - this was also part of Dumbledore's plan (why Dumbledore said “...You must kill me.”)
deathly hollows chapter the princes tale (scene Snape and Dumbledore talking about Malfoy)
...of course, there is only one thing to be done if we are to save him
from Lord Voldemort’s wrath.”
Snape raised his eyebrows and his tone was sardonic as he asked,
“Are you intending to let him kill you?”
“Certainly not. You must kill me.”
Snape must have realized, he too must die in order to make Voldemort believe that his death will make Voldemort the true master of the Elder Wand.
(why is it necessary for Voldemort to believe? So that Voldemort will not ask anybody else to kill Harry, Voldemort must be led to believe that that killing Dubledore's killer (Snape) will make him the master of the Unbeatable Wand. A wand that he can use to finally defeat and kill Harry.)
Deathly Hollows chapter the prince's tale
“So the boy . . . the boy must die?” asked Snape quite calmly.
“And Voldemort himself must do it, Severus. That is essential.”
- Snape must have also realized that Dumbledore did not trust him to calmly accept sacrificing himself. (same as Harry)
deathly hollows chapter the prince's tale
“Harry must not know, not until the last moment, not until it
is necessary, otherwise how could he have the strength to do what
must be done?”
Snape must have realized he is in the same boat as Harry. The full extent of Dumbledore's plan - for both of them to die - and for both of them to realize the necessity of their death, only at the last moment.
Snape must have also realized that since Voldemort called him here to kill him, then Voldemort is already prepared for any escape he might attempt.
So Snape could not disapparate because he was conflicted - he realizes that he must die for Dumbledore's plan to work - but he still has to tell Harry that he is also a horcrux.
Additional Edits slightly off topic - for Dumbledore's thought process:
Some canon background first.
from deathly Hollows chapter: King's Cross
“But you expected him to go after the wand?”
“I have been sure that he would try, ever since your wand beat
Voldemort’s in the graveyard of Little Hangleton.
At first, he was afraid that you had conquered him by superior skill. Once he had
kidnapped Ollivander, however, he discovered the existence of the
twin cores.
...naturally set out to
find the one wand that, they said, would beat any other.
...He believes that the Elder Wand removes his last weakness and
makes him truly invincible. Poor Severus . . .”
.
from Half-blood prince chapter Draco's Detour (Note Dumbledore still alive)
“Talking of Diagon Alley,” said Mr. Weasley, “looks like Ollivander's gone too.”
“The wandmaker?” said Ginny, looking startled.
“That’s the one. Shop’s empty. No sign of a struggle. No one knows whether he left voluntarily or was kidnapped.”
My interpretation: As early as "Goblet of Fire" (while Dumbledore was still alive) Dumbledore is sure that Voldemort will go after the wand. And Ollivander's abduction reinforced the idea that Voldemort was looking for a wand to defeat and kill Harry.
Now for the speculation of Dumbledore's plans and scenarios (in Dumbledore's mind):
Short Answer: Dumbledore intends to turn the Elder wand (Unbeatable wand) into a trap for Voldemort
Long Answer (with scenarios):
Voldemort steals the wand from Dumbledore's grave (thinking and "believing" that stealing the wand will be enough to make him the wand's master).
end results:
Snape would "not" have to die (preferable outcome - in Dumbledore's mind).
Voldemort won't order anybody else to kill Harry. Voldemort "believes" that he owns the Unbeatable Wand and Voldemort himself will want to kill Harry (which is the essential part of Dumbledore's plan).
Voldemort steals the wand "but" eventually deduces that he needs to kill Snape (Dumbledore's killer) to gain the Unbeatable Wand's loyalty.
end results:
Snape has to die (regrettable to Dumbledore's mind of course, but necessary)
Voldemort won't order anybody else to kill Harry. Voldemort "believes" that he owns the Unbeatable Wand and Voldemort himself will want to kill Harry (which is the essential part of Dumbledore's plan).
on another tack:
Malfoy succeeds in killing Dumbledore, then Voldemort steals the wand "but" eventually deduces that he needs to kill Malfoy (Dumbledore's killer) to gain the wands loyalty.
end results:
Snape would "not" have to die (fortunate for Snape).
Voldemort won't order anybody else to kill Harry. Voldemort "believes" that he owns the Unbeatable Wand and Voldemort himself will want to kill Harry (which is the essential part of Dumbledore's plan).
But, Dumbledore cannot allow an innocent child (Malfoy) to die for his plan. That is "one of the reasons" (but not the "only" reason) why he "asked" Snape to kill him.
Additional Edit 3: slightly off topic
With regards to Dumbledore's intent on whether Snape should own the wand after
Dumbledore's death (see the quotes below for reference)
Deathly Hallows chapter the Flaw in the plan
“He killed —”
“Aren’t you listening? Snape never beat Dumbledore! Dumbledore’s
death was planned between them! Dumbledore intended to die
undefeated, the wand’s last true master! If all had gone as planned,
the wand’s power would have died with him, because it had never
been won from him!”
.
Deathly Hallows chapter King's Cross
He believes that the Elder Wand removes his last weakness and
makes him truly invincible. Poor Severus . . .”
“If you planned your death with Snape, you meant him to end
up with the Elder Wand, didn’t you?”
“I admit that was my intention,” said Dumbledore, “but it did
not work as I intended, did it?”
“No,” said Harry. “That bit didn’t work out.”
The discrepancy is whether Dumbledore intended Snape to be the wand's master.
My speculation is the first quote should take precedence since it is more specific.
The second quote should actually be read as “If you planned your death with Snape, you
meant him (Voldemort) to end up with the Elder Wand, didn’t you?”
I realize using the word "him" in the second quote is confusing based on this thread
What were Dumbledore's actual intentions for the Elder Wand?
intentions-for-the-elder-wand
No, I'm not a grammar teacher nor a book editor :)
My speculation is that it was only in King's Cross chapter that Harry realized that
Voldemort was supposed to end up with the wand. Harry also needed to confirm this with
Dumbledore since only Dumbledore has the complete specifics of his own plan.
Harry realized that Dumbledore planned to turn the wand into a trap. A trap designed to
exploit Voldemort's desire to get an Unbeatable wand to kill Harry.
On another tack:
Dumbledore has a reason not to reveal to Snape his entire plan:
Deathly Hallows chapter The Prince's tale (Pensieve scene Snape and Dumbledore talking)
“I prefer not to put all of my secrets in one basket, particularly
not a basket that spends so much time dangling on the arm of Lord
Voldemort.”
“Which I do on your orders!”...
and
Deathly Hallows chapter The Prince's tale (Pensieve scene Snape and Dumbledore talking)
“After you have killed me, Severus —”
“You refuse to tell me everything, yet you expect that small service of me!” snarled
Snape, and real anger flared in the thin face
now. “You take a great deal for granted, Dumbledore! Perhaps I have
changed my mind!”
“You gave me your word, Severus. And while we are talking about
services you owe me, I thought you agreed to keep a close eye on
our young Slytherin friend?”
Snape looked angry, mutinous. Dumbledore sighed.
“Come to my office tonight, Severus, at eleven, and you shall not complain that I have no confidence in you. . . .”