Yes. It's the law and it was fairly applied. Samsung has been repeatedly found to have infringed Apple's patents. They could have licensed the IP or worked around it but they decided to litigate instead. It looks like the gambled didn't pay off. What will be interesting is if punitive damages will apply at some point in the future.
Roughly speaking IPR is motivated is basically a monopoly right given to the inventor in order to cover the cost of the invention and get a "fair" amount of profits for a certain period of time and geographical area. Moreover, patents cover the invention in such a way that competitors cannot create a new products/inventions too much similar to the patented one without paying for it. The infringement of the Apple patents has been clearly shown because Samsung deliberately used Apple patents to produce (too much) similar products.
However, is it really fair?
Broadly speaking, fairness depends on what do you think of the intellectual property rights (IPR), namely their uses and abuses (actually, there is a huge economic literature on this topic ).
If you believe that is fair to provide such a monopolistic power to the inventor etc. then, Samsung has been fairly punished. On the other hand, if you think that intellectual property rights may hamper innovation and/or competition because it makes difficult to create new products without violating some patent, the answer is no.