Coffee also contains very high levels of antioxidants, providing the bulk of the western world's antioxidant intake. So it balances out in the end. Coffee is also high in B2/B3, and provides some decent trace minerals when taken in large amounts. I used coffee as part of my stack to repair my liver and gallbladder after I had a bad reaction to PPIs a few years back (alongside active Bs, spinach, and turmeric). It can accelerate detoxification by upregulating glucuronosyltransferases.
Coffee should be well sourced and well processed though. It's one of those things people shouldn't skimp on if they want to drink it regularly. People also routinely cook it at way too high of temperatures, damaging many of the antioxidants it contains. It should be made around 80C or just lower, never above. Almost everyone makes it at 100C though.
Coffee is tolerable and has relatively great outcomes in most epidemiology research for a variety of disease end points. So it is clearly balancing out a large proportion of the population. I think it isn't good for some people, but I think that number is fewer. If anything, it's probably great for every one who is 50+ and on like 5 medications.