As she wanted frodo to stay true and I like Tolkiens narrative as written.
It also fulfills gandalfs prophecy of Bilbo not killing gollum would affect the fate of many.
If Frodo stays true, keeping gollum alive is pointless.
It's also a great narrative that even the best will fall when carrying so great of evil, but if they trust their friends, they can pull through.