Apple presumable also spent a lot on the development of their product, and so their product should be protected against copying it. But: Samsung ALSO spent a lot in development of their phones, the did NOT simply copy the whole thing - they are now being punished for copying a few very specific characteristics of Apples product; not for copying the whole thing. Unfortunately, while the infringement was a few small characteristics, the punishment is proportional to copying the whole thing.
That is the big difference: in pharma the patent is for the end product of those millions in investment, while in tech the patents are for thousands of very small details, which nevertheless are used to block entire products from the market and extort unreasonable amounts of money. Suppose that in pharmacology, each small sub-group of a molecule or sub-step in a process would be patentable -- then nobody would be able to develop any more drugs. That is what's happening in the tech industry right now.
At the very least, patent law should be changed so that small features of a product cannot be patented, or of they can, the amount of damages should stand in relation to the total profits as the development effort of that feature is in relation to the development of the entire product.