Question: why ned stark had to die?
Answer: Ned Stark was killed because he was an honourable man and by acting in his position, he would have been a threat to Joffrey's claim on the Throne. Had there been more people who stood by him, Joffrey's claim would have been rebutted by Ned.