Patents do somewhat work in the 'corporate' world, where potential inventions require a quantifiable capital investment that would obviously not be worth it in the absence of patent law (like antibiotics). But even then, companies often choose to keep the invention a secret if possible.
Software, generally is not like that, capital investment required is only quantifiable for 'big' applications, that do not require much creativity but simply a lot of work to create. And these applications are actually not the sort of thing that is patentable.
I think the reason patents are generally accepted is the 'righteus' notion that if someone invents something, he owns it and it cannot be stolen from him. But this notion is achterhaald, what if two people invent something at the same time? What someone invented the same thing a few years later, but actually succeeds in bringing it to market, unlike the first inventor?