This is very sad. Did the actor want to leave? She was really a delight and quite slashy with Carter a lot of the time.
So the story goes, at the time the episode was written everyone thought season 7 was going to be the last of the series, so the thought was "let's kill someone important," and Dr Fraiser was the one chosen. Ironically, it was during filming of Heroes part 2 that word that the show was picked up for an 8th season came through. The writers have said that had they known when the episode was written that there was going to be an 8th season they wouldn't have killed her.
Still, this I think that was one of the episode's strengths. Death is an unfortunate reality of military life, and very rarely is it going to be some random guy you never got a chance to know. This episode does an excellent job of depicting what that's like for everyone to have lost their friend of co-worker in the line of duty. I particularly like Hammond's speech about how officers are supposed to be detached from those they command, but that sometimes you can't help it but end up getting close to those under your command.
The Heroes two parter really does stand out as one of the best in the Stargate franchise, and the one which perfectly represents it. It is both funny (in part 1) and serious (in part 2).