I think covid deaths are not solely due to the viral infection. Unlike vaccines, covid can trigger cytokine storm or hyperinflammation that can harm several organs, including those burdened with pre-existing diseases.
Thus, in those with pre-existing diseases, the primary doctor probably judged that covid had played a role in the death, thus writing covid as part of the cause of death in the death certificate. I think this article explains this well:
https://www.aamc.org/news-insights/how-are-covid-19-deaths-counted-it-s-complicated