You are right strictly speaking, but misleading. In the vast majority of cases of people dying with COVID-19 from another condition, COVID-19 is the reason why this other condition became lethal. That's why it makes sense to attribute the death to COVID-19.