Case in point: Vanessa was fridged in Deadpool 2. Not because of the killer's motivation (he wasn't even out to kill her; her death was entirely collateral damage when he was actually trying to kill Wade). But because the only purpose her death in the story served was as a motivation for Wade for the rest of the film. This was a WRITER'S decision.
However, while it may not sit well with fans Nat was NOT fridged in End Game. The writers viewed her sacrifice as the culmination of her own character arc. While it factored into the plot for Clint and Banner, her death was still the product of her own development since her appearance in Iron Man 2. Once again, the motivation of the CHARACTERS involved in her death played no part in it, it was entirely about the WRITING.