Since a wild olive tree does not produce good fruit, it would seem to me that the reason would be that it has an inferior root system.  How then can a good olive branch that is grafted into a bad (wild) olive tree produce good fruit?

Firstly, your assumption is that 'good fruit' are those that can be eaten by humans, which is fine from a farming point of view, but ignores the reason that wild olives produce fruit - to propogate the species. 

Years of selective breeding produce olive varieties which have large, juicy and pleasantly tasting fruit which are ideal for eating, but in the meantime strong rooting charateristics such as abilities to extract nutrients and water from poor soils are lost. 

Your wild ('bad') olive trees may produce tiny fruit with big stones and a thin layer of bitter-tasting flesh but they have great root systems.  So farmers have learnt to graft the productive branches (giving the best quality olives) onto the most effective root systems (able to access all of the plants needs) and so produce a highly productive tree which is able to grow well in poor conditions.

This approach of grafting different fruiting types onto wild-type root stocks can also mean you can lengthen seasons and range of produce - we have a wild lemon rootstock in our garden with mandarin, grapefruit and satsuma branches grafted onto it, and my father-in-law had five different mango varieties on a single root stock, giving a long season and lots of variety in fruit types.  Yum!