It probably wouldn't have been cheaper. The settlement would likely look like a fixed fee for previous use + yearly fee for X years before renegotiation, renegotiated y times before the patent expired.
It's likely that over the lifetime of the patent, the total cost would have been more than the cost to fight it, and as the a sibling pointed out, settling begets more suits + settlements. It adds up fast.
This isn't Cloudflare being "good," it's in their best interest to fight frivolous suits.