The Unicorns became extinct because of a combination of stupidity and vanity. And bad luck.
In the Olden Days, Unicorns were to be found wandering around their natural habitat of misty, moonlit glades. And, often, rather than wandering, they could be seen gazing, admiringly, at their own reflections in the tranquil pool without which no misty, moonlit glade can be truly said to be complete. A Unicorn would continue to make sheep's eyes at his (or her) own reflection until, lost in narcissistic worship, his (or her) horn would break both the surface of the tranquil pool and the spell.
With the invention of mirrors, things went downhill. The clearer reflections provided by mirrors captivated Unicorns even more than those given by tranquil pools in misty, moonlit glades. And rather than harmlessly breaking the surface of a tranquil pool, Unicorns found themselves breaking mirrors. And, being Magical Creatures, Unicorns were especially susceptible to the accumulations (in seven year bundles) of bad luck.
Unicorns were killed by a series of unfortunate accidents - piano-falling-out-of-aeroplane incidents were the biggest cause of Unicorn mortality. Their extinction was inevitable.
The last Unicorn died on 23rd April 1997 when he was run over whilst crossing the road on his way to pick up the winnings from his Euro-Millions lottery ticket.