The wand did exactly what Voldemort (and Harry) wanted.
Harry was willing to die and VoldemortsVoldemort's intention was to kill Harry. So the wand had actually no alternative to killing Harry.
This also explains why Voldemort could ”kill” Harry at that instance but was not able to kill him in the final duel, as at that point, Harry was not willing to die anymore.