This comes down to what is and is not copyrightable. 'Code', whatever that is, very obviously is copyrightable - hence licensing. 'APIs' are now being separated from code by Google to support their claim that they did not violate Oracle's copyright.
To me, if I write a program under license X, it is strange to me that someone can reimplement my program's API under an incompatible license Y. To me, that violates my license, and software licenses are enforced via copyright protection.