Copyright and patents are written into the US Constitution. The wording allows congress to pass laws granting for a limited time exclusive access to their creators. The Supreme Court of the US has held that congress can declare any duration as limited as long as it is not literally forever. There is nothing unconstitutional about copyright law.