Because she did have to die. If she'd only been wounded, Willow would not have become Super!Evil!Willow and tried to destroy the world. And if she hadn't tried to destroy the world, then she never would have been stopped によって Xander. And if she hadn't been stopped によって Xander, then she never would have gone to England with Giles and honed her powers. And if she hadn't honed her powers, she never would have been able to create every potential slayer into a slayer. And if she hadn't done that, then The First would have won.
In short: if Tara didn't die, the entire world would have been destroyed.
Because Joss Whedon is evil and loves to kill off the characters we love...lol...Although I hated it when she died it was necessary. Willow, as an addict (to magic), had to hit rock bottom in order to be saved and the only way to do that was to take away the most important thing in her life which was Tara.