For one thing, there are many "inventions" that are not patentable. The "inventor" of the supermarket, for example, conferred great benefits on his fellowmen for which he could not charge them. Insofar as the same kind of ability is required for the one kind of invention as for the other, the existence of patents tends to divert activity to patentable inventions.
Milton Friedman (2009). “Capitalism and Freedom: Fortieth Anniversary Edition”, p.127, University of Chicago Press