5 Timey Wimey Clues To Where Ruth Fits In Doctor Who Canon
5. Time Lords Can Selectively Wipe Memories
In the classic story, The War Games, the Time Lords arrested the Second Doctor and put him on trial for breaking the laws of time. One consequence of his capture was that they chose to selectively wipe the memories of the Doctor's two companions, Jamie and Zoe, erasing all but their earliest adventure with him.
It's worth noting that while The Doctor as a Time Lord has an inborn resistance to psychic attacks, he is not immune to having his memories altered. During the episode Time Heist he uses memory worms to erase his own memory and later in Hell Bent, Clara uses a Time Lord device to selectively erase his memories of her.
This is the most likely explanation for why the Thirteenth Doctor does not remember ever being Ruth. Because she once worked for the Time Lords in some covert capacity before going rogue, and when they finally caught up with her they did not want their secrets known to a renegade like The Doctor. They adjusted her memories to erase that entire incarnation.
Having successfully done this to The Doctor, it is possible that The Time Lords put The Master under the same kind of mind wipe and he took his revenge on Gallifrey after learning the truth.