Ned Stark died because he was betrayed by Petyr “Littlefinger” Baelish, who had promised him the support of the City Watch, but instead sided with the Lannisters. He was arrested for treason after Robert died and Joffrey claimed the throne.