Sure, patents are a different thing, but they serve a similar purpose. "If you don't have to to the research and invest in creating the technology by copying, you can do it cheaper which the market will reward" is what both copyright and patents are created to change.
In seriousness, they didn’t copy the libraries just once, but at least 3 times over time as Oracle continued to make investments in changes and additions to the libraries.