Answer:
The Supreme Court ruled that the name Coke was so well known around the world, that it is effectively a common term for the trademarked Coca Cola. If other companies try to use similar terms like Koke for other types of products, e.g. bakery items, there is a risk that the Coca Cola company would be negatively affected by that product's image since consumers might associate Koke directly to Coca Cola.
It doesn't matter if the products were low quality or not, the courts cannot determine that, what matters is that the use of the term may negatively impact another company.