The very simple and short answer:
Because Harry was never defeated as Master of the Elder Wand
alexwlchan’s answer has already pointed out that the Snatchers and Nagini’s attack on Harry occurred before Harry was Master of the Elder Wand and therefore do not affect this in any way; the following explains why Voldemort did not become the Wand’s Master after killing Harry.
The much more complex and longer answer:
As is mentioned many times throughout the series, wandlore is a complex and not fully understood subject. Even experts like Ollivander (and Dumbledore, it must be added) do not fully understand it and are frequently left with no better alternative than to make educated conjectures. However, it seems clear from various tales and incidents throughout the books that the Elder Wand was actually different from other wands in how it chose and changed its allegiance.
Allegiance in regular wands
As far as we can tell, regular wands maintain their allegiance to their master until they are forcibly taken from the master and not returned. These remarks by Ollivander bear that out (all quotes from the books are from the UK/Bloomsbury versions):
‘Hawthorn and unicorn hair. Ten inches precisely. Reasonably springy. This was the wand of Draco Malfoy.’
‘Was?’ repeated Harry. ‘Isn’t it still his?’
‘Perhaps not. If you took it –’
‘– I did –’
‘– then it may be yours. Of course, the manner of taking matters. Much also depends upon the wand itself. In general, however, where a wand has been won, its allegiance will change.’
Deathly Hallows, ch. 24 “The Wandmaker”, p. 399
Note that Harry took the wand from Draco here, at Malfoy Manor. He did not use magic to do so, but he took the wand nonetheless, and he did not intend to give it back (and I think it’s safe to assume that Draco did not willingly let Harry have it):
As Ron ran to pull Hermione out of the wreckage, Harry took his chance; he leapt over an armchair and wrested the three wands from Draco’s grip, pointed all of them at Greyback and yelled: ’Stupefy!’
On the other hand, practice sessions and games do not seem to constitute ‘winning’ a wand. Since people can often feel it if they are using a wand they are not the master of, we would expect quite a lot of Hogwarts students to lose mastery of their wands every time someone Expelliarmus’ed them in class or in DA (Dumbledore’s Army, not Dark Arts) training. Simply beating someone up does not cause their wand to change allegiance, either, or Hermione would have won Draco’s wand when she punched him in the face in the third year, for example. Finally, there are several instances of people borrowing wands from each other with no sign that the wands perform suboptimally for the borrower.
Allegiance in the Elder Wand
The Elder Wand, on the other hand, has neither of these limitations. It is (presumably) the most powerful wand in existence, but it is also more fickle than regular wands. It changes allegiance as soon as it senses that its current master has been defeated or bested by another wizard, in any way:
- When its original owner, a Peverell brother, is knifed in his sleep, it changes its allegiance (though it is not taken from him until after death)
- When Draco disarms Dumbledore at the top of the Astronomy Tower, it changes its allegiance (though Draco never takes it)
- When Harry bests Draco by scuffling with him and forcibly taking his wand at Malfoy Manor, it changes its allegiance (though Draco doesn’t even have it)
Defeat and intent
Very crucial here, however, is the concept of being defeated. We need to look at Dumbledore’s plans for his own death a year earlier for this:
‘Well, really, this makes matters much more straightforward.’
Snape looked perplexed. Dumbledore smiled.
‘I refer to the plan Lord Voldemort is revolving around me. His plan to have the poor Malfoy boy murder me.’ […]
‘The Dark Lord does not expect Draco to succeed.’ […]
‘Now, I should have thought the natural successor to the job, once Draco fails, is yourself?’
‘That, I think, is the Dark Lord’s plan.’ […]
‘Ultimately, of course, there is only one thing to be done if we are to save [Draco] 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.’
Deathly Hallows, ch. 33 “The Prince’s Tale”, p. 549–550
It was Dumbledore’s belief (correct, as it turned out) that if his objective was to be killed, the Elder Wand would not consider him defeated and would not change its allegiance. Its allegiance would remain with a dead man, and there would be no True Master to wield the wand. If you intend to lose, losing is actually winning. However:
‘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 had intended, did it?’
Deathly Hallows, ch. 35 “King’s Cross”, p. 578
From this, we glean that Draco disarming Dumbledore was a chink in the plan. The wand considered Dumbledore defeated when it was forcibly taken from him—and losing the wand before being killed was not part of his plan. His plan had failed, and the Elder Wand still had a True Master, although this master is not aware of it.
For the exact same reason, when Harry entered the clearing in the Forest and let Voldemort kill him, he was not defeated. Quite the opposite: he won that duel. Being killed was precisely his intention. If one of the Death Eaters standing there had sprung forth and disarmed him first, it is entirely possible that that Death Eater would have won the Wand’s allegiance, because that was not part of his plan or intent—but unlike with Dumbledore, no one did. Harry allowed Voldemort to kill him, and the Wand’s allegiance remained with him when he died, and after he came back from King’s Cross as well.
Harry is not Master of the Elder Wand for very long, and during the time he is, he is only involved in four real fights:
- charging their way out of Gringotts
- fighting Draco, Crabbe, and Goyle in the Room of Requirements
- his non-duel with Voldemort in the Forest
- his duel with Voldemort in the Great Hall
The only one of these that could count as a defeat is 3, but the fact that 3 is also a victory is confirmed both by Dumbledore’s plan and the fact that the Elder Wand hadn’t changed its allegiance before 4, when Voldemort ends up killing himself (again).