The difference is that an algorithms patent is a patent on a mathematics; a patent on a drug is not a patent on a law of nature. That is why software patents try to make clever end-runs around the restrictions on patents by saying things like, "...on a computer."