From, like, season 1 on Dany is established to be explosively vindictive, especially to perceived betrayal by those who are either personally trusted or whom she feels owe her duty, as well as desperate for (and violence tempered only by) receiving love on both an individual and mass level.
And those factors are directly the source of the violence she turns to in S8E5. The direct lead up has been decidedly unsubtle and started before S8. It wasn't a culmination of increasingly morally gray choices, it was a simple continuation of a pattern of behavior that's been constant the whole show combined with a pattern of increasing erosion of the factors that were previously established as mitigators combined with an increasing accumulation of factors previously established as triggers.
That it was headed for something like this has been evident for some time, that it was likely to erupt at the particular time it did against the particular target was clear in S8E4 with Missandei’s killing even before they laid on more triggers in the part of S8E5 preceding the break.