I was thinking the same thing, he's just sort of irritating some times, but he didn't deserve to be dismembered and eviscerated. The window thing was just panic.
It wasn't what he did, it was how he went about it.
He perpetually made wrong calls, was whining when Shaun and the others were trying to be proactive, and the one time he was right, about killing Shaun's mother in order to protect the group, he acted like a complete callous, sanctimonious a-hole. He was revelling in being the objective, reasonable one for once (since he'd hitherto displayed nothing but cynicism and cowardice), rather than demonstrating any degree of sympathy and understanding for the decision Shaun, admittedly had to, make.
In short, he was acting like a normal human being...what you think going around hitting people on the head with a cricket bat (even if they were zombies) was normal.....and his call to quietly stay at Liz's apartment in the beginning was the right call which would have probably saved all their lives, as opposed to going to the local pub with it's large glass windows and large amount of zombies surrounding it, which was Shaun's idea in the first place if we remember correctly.
Let's face it, David's only fault was that he was just not a very likable guy in the given situation.
I've been thinking about this since last night when I had a dream about David's death. Yes, he was acting like an ass (and I didn't particularly like him) but I still think his death was horrible.
He was a self righteous prick who had it out for Shaun because he's been in love with Liz forever. He was just really annoying and yeah he was right to want to stay at Liz's flat, but he pulled the trigger on Shaun. He got everything coming to him. Very satisfying death scene.
He was very passive-aggressive and whiny and always tried to undercut Shaun in situations where it didn't help (when they've left the apartment and Shaun is trying to think of how to get to the Winchester through the big herd). He also took some level of pleasure in trying to shoot Shaun's mom since it was also a way to get back at Shaun. Like Liz said: "I can see what David is trying to say, even if he is being a twat."