I don't think patents are inherently evil, however they certainly can be used for evil.
But The basic idea is sound. If you invent a novel mechanism and publish it the government will grant you exclusive economic exploitation rights to that mechanism for the next 25 years. After that it is now fair game.
It is an attempt to solve the real problem that it is much harder to be first than second, the guy in first place has to spend all that time and effort to develop the thing, and the guy in second just has to copy the guy in first. To rectify this social injustice the patent system was developed, where the government would grant and enforce economic exploitation rights of the mechanism to the inventor.
The problem often stems from the Patent Offices getting caught flat-footed with new tech. When the patent officers don't know enough about the field they are reviewing it is easy for things which are "obvious to experts in the field" or "overly broad" to slip thru and cause major headaches for everyone.