We can't control what another person does. We are all responsible for our own actions, and that includes those who ultimately choose to take their lives. In answer to your question, people say these things because they simply have no idea. When someone dies in these truly horrible circumstances they will trot out the same tired platitudes for the want of finding something to say that's less ignorant, more measured, and more considered.
It's the same tune for those left behind when an addict succumbs to their addiction. The thoughtless, ignoramus observation, which never fails to be trotted out, is: 'but why didn't the family do something?' Or: 'Why did they "let" them do that?' Such people can have no idea of the utter anguish of watching a loved one destroying themselves little by little, whilst you do every conceivable thing to help them but in the end know that you are utterly powerless to stop them. The only person who can get themselves into recovery, and somehow find the will to stay there, is the addict themselves.
As if those who have lost dear ones in such hideous circumstances need to be further laid under the harsh guilt trip they undoubtedly also take upon themselves, or to have the pain of their bereavement further intensified by this sort of behaviour.
I can't answer for what goes on in the minds of those people. It's as callous as the equally mindless, thought-free cliche of 'hugging my loved ones a little closer tonight!' Okay, so on that one at least, it's likely that many of us do think it. But it takes a special kind of insensitive, uninsightful dick actually to come out and say it.
for you and for your friend. I'm sorry.