Further. In fields like medicine, you have a huge upfront research cost. Patents allow them to recoup that research cost.
Patents (and copyright) aren't bad. It when it becomes too broad. Not reflective of the effort involved, or too long lasting when it becomes an issue.
Fwiw, early steam engines were also patented, and that slowed down development until the patents expired.