It was the actors choice that they end Data's life because he said that they had done everything they could with Data and their was no further growth therefore point to do any more stories with Data in them. By the way I think the whole thing with B4 was to show that Doctor Soong's work would not die with Data but live on.
They didn't need to kill him. They just didn't need to use him anymore. I personally refuse to acknowledge Nemesis as canon. Its like the 1960s James Bond Casino Royale or Threshold. TNG ended with All Good Things.