There is no explanation for why some go on and some get cut short. And there is little consolation when death comes to someone close to us. Philosophizing falls so short at times like these.
I am terribly sorry to hear of the loss of your friend.
Bart