Indeed. Patents incentivize investment in R&D. There is an argument to be made that the scope of patentable inventions should be more limited, in particular preventing trivial patents that didn’t require substantial R&D, and maybe also that patents shouldn’t last as long.
But doing away completely with patents would certainly stifle companies’ willingness to invest in R&D. They’d rather wait for someone else to invent something they can copy.