This system has failed in a number of ways.
1. The rate of technological evolution was significantly slower, and a time-limited monopoly was less impactful, in previous history. The industrial revolution covers some 100 year period. The digital revolution covers about 40. Things get obsoleted much faster these days, to the point that a 20-year monopoly is literally the whole lifetime of the technology
2. Patents have been granted too easily for too little (largely because there’s no repercussion for filing, and re-filing, dumb patents) allowing for extremely broad interpretations, and a single technology incorporating hundreds of different patents (eg h265)
3. Because there’s so many of them, and they’re often so vaguely defined, I’m fairly certain almost no one actually reads them to learn how to implement something, or improve on the design. I’m also fairly certain that reading patents is a great way to “poison” yourself — if it can be shown you read the parent at some point, and then violated it, it’s a trivial lawsuit.
The key for both is that the government is providing exclusive security of tenure over some natural opportunity in order to facilitate production. But if people take the opportunity but don't do anything with it, whether for speculation or laziness, they are excluding others. That would only be acceptable if they have paid the community for that right to do so.
Otherwise, patents are to protect profits companies must recoup for their R&D spending.