The Last Of The Starks - S8-E4
Other mistake: During the scene in the banquet hall, as Tormund says "most people get bloody murdered, they stay that way", look at Daenerys in the background - a disposable coffee cup is on the table in front of her. This brown cup with a white plastic lid is nothing remotely like the style of cups they're all drinking from in the scene. HBO acknowledged the slip up and digitally edited it out on streaming services, reruns and future DVD releases.
Answer: Basically it's because he broke his vow. A member of the Kingsguard is sworn to protect the king at all costs. Jaime elaborates more on the deed to both Catelyn Stark and Brienne of Tarth, telling Catelyn that no matter what course of action he took, he would be breaking one vow or another (i.e. if he obeyed the king, he would conversely be disobeying his own father), and telling Brienne that the Mad King was planning on burning all of King's Landing, but he did not bother to tell Ned Stark that. Ned Stark felt that killing Aerys was dishonorable and excessive. Robert Baratheon still could have usurped the throne without Aerys being killed.