Many distribution agreements have a clause saying the distributor can't create their own product and compete. The reason is, as a distributor, you get a lot of insight into the customers, the product, the pricing. It's completely reasonable when you consider the full value chain of a product. Further, if Apple did compete in the search engine business, many would claim they would be unfairly competing by using their dominant market position in smart phones to dominate another industry.
Competition issues are complex.
Alternatively, Apple could have forced Google to pay, as part of a money skimming exercise because Apple has Google by the balls so why not get a cut?
Without more information, it is just picking sides to speculate that Google is the bad guy and Apple is the good guy.
Although it occurs to me that you might mean Apple should build their own search engine - which is a terrible idea. Google is really good at search engines and Apple wants their customers to have the best experience. Forcing Apple to build and promote an inferior search engine would be terrible for everyone.