Private entities invest in research and development. If they find something incredible, they release the full details to the world of what they found, and in return we give them monopoly on the invention for a period of time. That's a patent.
Take away the incentive and private entities won't invest in research.
The public appetite for investing in basic research with government funding is pretty low. So instead of waiting 20 years for the patent to expire, during which we're all paying a premium on the invention, we instead spend 20 or more years without the invention at all because no research was funded to find it. Maybe longer.