Masters became a better House than House himself. Because of that, she had to leave.
House is getting better, mind you. He seems to be remembering what’s important (chickens notwithstanding). The diagnosis is everything. Maybe having Masters around helped restore him to his former detached, focused self.
Martha Masters will (I imagine) still become a doctor. She did no harm with her ethical fudging (unlike Chase, who really should not be a doctor anymore). But she needed to escape the temptations of House and his abstract approach to medicine, and could only do that successfully once she proved she was good enough to be on House’s team, had she wanted to.
It was a great episode. Amber Tamblyn was wonderful. The director might be criticized a bit for some gratuitous shots of Tamblyn and the chicken, but it was a great exit for a great character.