In any one specific case, fixing a litigious customer's laptop is definitely cheaper for Apple. But by having a policy of fighting legal claims vigorously regardless of merit, they can make it wildly uneconomic for customers to sue, which decreases the probability of getting sued. I suspect the economics of their behavior work quite well overall.