The difference then might be that Kirk and Spock had a very close friendship, while in all honesty Janeway and the Doctor did not. Many fans (myself included) believe that Spock did not erase Kirk memories of the last few days wholesale, but instead removed the intensity of Kirk's emotional pain. Kirk retained his memories of Rayna, but the anguish was gone. Janeway edited out selected memories from the Doctor, so as that the ship's only medical professional could continue to function and serve the ship. Her primary motivation wasn't the Doctor's personal well being. While never seen on screen, there a good possibility that Spock voluntarily a short time later told Kirk exactly what he did, and would have received Kirk's approval. Kirk trusted Spock. Janeway was basically forced to inform the Doctor of her actions.