These kinds of fines are usually issued for contempt of court. Judges don't take kindly to parties that try to ignore a court order, which would include writing off a court imposed fine as a cost of business.
There's few things more terrifying than an angry judge with full power of contempt. There's no principle of proportionality, which gives judges almost unlimited authority. See Chadwick v Janecka (3rd Cir. 2002) as an example.
What's the worst thing the government could do to Yahoo that would go unnoticed by the public, if Yahoo didn't comply?
But if your point is that the NSA have no law enforcement role, that's salient.
Also: check your mail WRT http://idlewords.com/bt14.htm
I've posted a few fixes to that (excellent piece BTW) from my gmail account.
Yahoo is about to get $20bn+ in cash in about 2 weeks, so they can hold out these fines for about 80,000 days.