It was especially cutting when the show teased this was going to happen again to Clara, but then the twist is the Doctor himself is the one who gets his mind wiped, which very much came off as the show acknowledging what a crap deal Donna got. And if he can eventually get those memories back, why not her?