I think the ending was perfect--I mean, it would've completely sucked if Light would've "won" at the end. The fact that Matsuda killed him was even better. If you think about it, nearly all of the main characters are evil people in some way or another. Honestly I think that if L was given completely free reign over the investigation, it would've been conducted in a much more ruthless manor. Matsuda is the true underdog, and one of the few characters (at least of those alive at the end) whom was honestly a good person. I couldn't have imagined a better way for the series to end.
L's death, while extraordinarily tragic, was also very well done. I mean, I'm re-reading the manga right now and I was on the edge of my seat the entire scene--everything just falls into place so perfectly.