It all smacks to me of Martin being a sadist/attention whore who wants to just be all counter and shock his readers/audience - "Look at me! I can write a book where good DOES NOT triumph and evil sometimes wins!"
To me it 'smacks' of Martin being a fantastic writer. Every bad thing that happens to good people is the natural result of their own foolish actions. Ned was naive and his perspective was limited to that of his own honor-bound view and (TV)Robb was basically a rebellious teen who thought himself invincible.
In the books, there is nothing 'twist' about these deaths, you can follow them from action to action to action until they are the only possible solution to the plot. You may not see it at first, but it is all there.
It isn't about being shocking and 'grimmdark' as some like to call it. It is about telling the story of this kingdom through all the war and politics and the Starks just happen to be the most sympathetic side in the mess and thus made good protagonists. War is messy, revolution is messy(and rarely successful), the most moral and honorable sides usually lose. And in the end, that will make the victory of the few remaining 'heroes' that much sweeter.