Google probably based part of its decision on the huge existing body of code and tools developed by the Java community that depended on the existing API and VM, aided and encouraged by Sun (which included clean-room VM implementations).
Fair use exists so that fans of Mickey Mouse can put up websites about Mickey Mouse, write reviews of cartoons, etc. Disney benefits from this activity, just as Sun has benefited from all of its pre-2010 goodwill toward Java.
Right, but the problem for Google is that Judge Alsop ruled as a matter of Law that API is not copyrightable. So that mooted the defense for Google's actions under fair use. This seems like a major ruling. Now Google is going to have to go back to trial with a fair use defense as the outcome of that portion of the original trial did not provide enough factual basis for the appellate court to rule.
Fair use exists so that fans of Mickey Mouse can put up websites about Mickey Mouse, write reviews of cartoons, etc. Disney benefits from this activity, just as Sun has benefited from all of its pre-2010 goodwill toward Java.