She wanted to protect him. Not just from the danger that he was in because of his association with her. While it was clear that Ginny at least was keeping his secret relationship with their most hated foe from the rest of the Resistance, Hermione knew that if he was discovered by the rest of them to be harboring her, he would be in serious trouble. From the moment of his whispered confession, she knew she couldn't stay. He deserved better than the misery she would bring him. All she was good for was ruin and destruction. Cutting off what they had before either of them could get too far down a path of no return was a kindness. She only hoped that he would see it that way.