Ned was a self-righteous jerk that had it coming. He rubbed Jamie's nose in his kingslaying every chance he got, and even mocked Jamie for "choosing his opponents wisely". He shows up at Kings Landing and promptly tells everyone what screwups they were, pissing everyone off. He was playing the game by getting his dying best friend to sign a note under false pretenses, and then, when handed the 7 Kingdoms by Renly, Ned says "no, I'm good", and walks into the Throne Room alone. He was even a jackass in flashbacks, showing up at the Tower of Joy and giving the two Kingsguard a lecture on duty rather than trying a "let's let bygones be bygones" approach.
Or maybe he was subconsciously suicidal after being married to that stupid harpy for 16 years.