No doubt, the food in McDonalds is bad. But it's very distinctive. You can buy a burger and fries at any number of joints, but you can only buy a McDonalds Big Mac and McDonalds fries at McDonalds.
You could call it Hershey Syndrome. Hershey's chocolate is not very good. In fact, it tastes like vomit. Yet the entire US has grown up eating Hershey bars.
Hershey don't compete on quality, they compete on "Hersheyness".
Likewise, McDonalds can't simply improve quality, because they would be losing their very essence in the process.