He didn't — not permanently, anyway.
Shadow's apparent death at the end of Sonic Adventure 2 is one of the series' most famous moments: he falls from the Space Colony ARK while stopping it from crashing into Earth. For a while, that really did look like the end of him.
Then Shadow the Hedgehog revealed he'd been saved — recovered by one of Dr. Eggman's robots, which is how he's around to star in his own game. It's a comic-book resurrection, and the series has never been shy about those.
So the answer depends on which game you stopped playing at. In Adventure 2, he dies heroically. Afterwards, he very much doesn't.