Here's why:
* The Elder Wand's allegiance: The Elder Wand is a powerful magical object that changes allegiance to the person who disarms its previous owner.
* Snape's Disarming: Severus Snape disarmed Dumbledore in a duel, which meant the Elder Wand's allegiance transferred to Snape.
* Malfoy's Disarming: However, Draco Malfoy disarmed Snape in the Shrieking Shack. This meant the Elder Wand's allegiance then shifted to Malfoy.
* Harry's Disarming: When Harry disarmed Malfoy during their duel, the Elder Wand's allegiance transferred to Harry.
While Snape technically held the Elder Wand for a short time, it's arguably Draco Malfoy who was its true owner for a period of time, albeit unknowingly.