It was the right decision for the story they were telling - had K'Ehleyr not been killed, Worf would not have killed Duras. Had Duras not been killed, Gowron would not have become Chancellor. Had Gowron not become Chancellor, the Klingon Civil War would not have begun.
Likewise, without K'Ehleyr's death, Alexander would not have been left in Worf's care. I'll grant that there are still stories that could have been told with K'Ehleyr alive, but it served Worf's character better for her to die - her death allowed him the opportunity to both reclaim his family honor and become a father, both of which were more difficult to show with her still alive.
Yes, they needed her to die for the story.
Besides, it seemed to be an unwritten rule that TNG couldn't have a regular in an actual relationship.
But it was a shame since I liked her and found her more interesting than Worf, or the majority of TNG regulars.