From the ruling:
In answering this question, we have used the word “transformative” to describe a copying use that adds something new and important. Campbell, 510 U. S., at 579. An Cite as: 593 U. S. ____ (2021) 25 Opinion of the Court “‘artistic painting’” might, for example, fall within the scope of fair use even though it precisely replicates a copyrighted “‘advertising logo to make a comment about consumerism.’”
I would argue that the use of the Goldsmith art to create the silk screens was needed for the "interoperability" of the statement warhol was trying to make.
The fact that it IS specific, recognizable art is what makes the actual mental connection, a sort of "API of the psyche", if you will, and hopefully conveys the desired information to the endpoint, or viewer.
None of those concerns exist in this case of Warhol copying a photo of Prince. There may certainly be other reasonable reasons for or against Warhol's use of the photo on fair use grounds, but the Google v. Oracle case is not one of them.