Chapter 15 doesn't explicitly explain why Sophie helps David, but I think two factors contribute to Sophie's help. The first is that Sophie knows that David kept her mutation a secret all those years ago. She has six toes, and David finds out about it in at the very beginning of the story. David's entire society is trained to look for "deviant" genetic expressions so that those people can be killed, sterilized, or banished. David does not report Sophie, and I think Sophie helps David in chapter 15 as a way of returning the favor.
The other reason I think Sophie helps David is because she knows that he and Rosalind will leave together. Sophie wants to protect David, but she also very much wants Rosalind gone. Sophie, who has been sterilized, is in love with Gordon, and Sophie fears that Gordon will cast her aside in favor of Rosalind, who is fertile. By helping David, she knows that he will take Rosalind with him, and Sophie will once again have Gordon's affections:
"If she were to give him children, he wouldn't want me any more," she said at last.
There was still enough light to catch a glistening on her cheeks.
"Sophie dear," I said. "Are you in love with him—with this spider-man?"
"Oh, don't call him that—please—we can't any of us help being what we are. His name's Gordon. He's kind to me, David. He's fond of me. You've got to have as little as I have to know how much that means. You've never known loneliness. You can't understand the awful emptiness that's waiting all round us here. I'd have given him babies gladly, if I could."