The difference between a soldier and a slave is free will. When Gretchen chooses to sacrifice herself so that others might live she is breaking her programming. Humans may be hard-wired to survive but Gretchen overrides that instinct for the greater good. It must be a huge surprise when she wakes up to tea in a so-called heaven. Something tells me the mysterious Missy isnt an angel well perhaps an avenging one. The Doctor gives the dalek the gift of free will but he doesnt like what the dalek chooses to do with it. But thats the thing about free will its out of any other persons control. The freedom to choose makes for a messy universe but it also engenders the potential for a better one. Is the Doctor a good man? Of course he isnt. Hes not a bad man either. As Clara states, the important part is that hes trying to do the right thing. Thats all any of us can do. Life isnt clear-cut.