Question: why daenerys had to die?
Answer: As Jon said earlier in the episode, there was no way to explain what Dany did, let alone defend it. After massacring the innocent people of King's Landing, there was no way the survivors could allow her to sit on the Iron Throne and still sleep soundly at night. Once Dany became the Mad Queen, she had to die.