The problem is not the concept, but the current application. And that is not even a construct of the law as written, but the courts application of said law.
Patents started out as a 20 year protection on mechanical mechanisms or chemical processes as long as what was protected was publicly documented in full. Thus once the patent had run out, anyone could replicate it from the patent document.
But then the chemical process side used to argue for a quasi-software patent in court, because the patent described a computer monitored mixing process. And thus the ball got rolling.
Thing is though that 20 years is a very long time when we are talking software. By the time the RSA patent ran out, the algorithm described was largely obsolete.
On top of that we have gotten a mass of patents that are so generic in terminology, that even if they describe something mechanical they can potentially be applied to something done in software.
Not that patents have not been a problem even before computers. Serious refinements of the steam engine for example didn't happen until after the initial patent ran out.
Similarly Smith and Weston sat on their refinements for the Colt revolver until the patent ran out.