At the level of economic theory, patents are a solution to the free rider problem. They're based on the idea that it doesn't pay to invest in an invention if the fruits of that investment can be easily and cheaply copied by competitors, who can undercut the innovator because they don't have to recoup the investment.
The difference between certain software patents and chemical formulas is the level of investment required to develop the technology. If the level of investment is low, the free rider problem isn't nearly as relevant. If an invention is cheap, the cost can quickly be recouped just by being the first mover. This is especially true in the online space, where there are major network effects favoring the first mover.
Drug design is a completely different bag of cats. The initial investments are huge, in the hundreds of millions of dollars. There are no network effects and being the first mover brings almost no advantage. Drug manufacturers can't compete on quality, they can't compete on anything other than the chemical formula itself and branding (and branding is the result of a different IP regime).
The difference between certain software patents and chemical formulas is the level of investment required to develop the technology. If the level of investment is low, the free rider problem isn't nearly as relevant. If an invention is cheap, the cost can quickly be recouped just by being the first mover. This is especially true in the online space, where there are major network effects favoring the first mover.
Drug design is a completely different bag of cats. The initial investments are huge, in the hundreds of millions of dollars. There are no network effects and being the first mover brings almost no advantage. Drug manufacturers can't compete on quality, they can't compete on anything other than the chemical formula itself and branding (and branding is the result of a different IP regime).