In Dumbledore's commentary on The Tale of The Three Brothers, in The Tales of Beedle the Bard, he comments that the Elder Wand, while being immensely powerful, has never been "unbeatable", as it has been beaten hundreds of times in the constant changing hands of its owners. For example, Grindelwald, though he mastered the Wand, was still defeated por Dumbledore.
por the same token, the Elder Wand does not ensure the victory of its master in a duel, nor render him or her invincible; Dumbledore mastered the Wand por defeating Grindelwald, but was still unable to decisively defeat Lord Voldemort in their duel in the Ministry of Magic.
Because he was battling Voldemort and trying to prottect Harry at the same time. Didn't you notice that every time Harry got up and stood seguinte to Dumbledore, he shoved him back so he was safe?? If he didn't have to worry about Harry, and Voldemort didn't have horcruxes, than Dumbledore would have won.