Board Thread:Questions and Answers/@comment-29616136-20160813104312/@comment-26521006-20160822103854

It's implied that she can open/unlock the door whenever she wants (See: the door being locked right after the protagonist exits the Ruins, the monsters mentioning that Toriel leaves the Ruins in the True Pacifist Route epilogue, and the "Exiled Queen" epilogue where Papyrus and Sans convinces Toriel to leave the Ruins sometimes), she probably chooses not to for "personal reasons".