It was later revealed in the book "Harry Potter and the Deathly Hallows" that Harry didn't become the true master of the Elder Wand, as he never truly defeated Draco in battle. It was the act of Harry disarming Draco, while Draco still had the allegiance of the wand, that caused the allegiance of the Elder Wand to switch to Harry.
The true master of the Elder Wand was ultimately revealed to be Albus Dumbledore, who possessed it until he was disarmed by Draco Malfoy during the events of "Harry Potter and the Half-Blood Prince." Therefore, the wand's allegiance always remained with Dumbledore, and it was his act of defeating Grindelwald that made him its true master, not Harry Potter.