Board Thread:Naruto Discussions/@comment-45206595-20200311224438/@comment-1210805-20200312130716

She was branded with Madara's curse mark to ensure his plan worked out. Madara even suggests that she worked this out and made sure to die in such a way that the curse mark would be destroyed as well. She was always going to die, the only choice she really had was how to do it and she made the call that the safest course of action to protect Konoha was to die right there and then.