Doesn't the CIA (like all external intelligence agencies in all countries) pretty much exist to obtain information through extra-level means?
While conducting these clandestine operations they may also collect information which could convict someone domestically in court... but US courts will not permit that evidence to be submitted as it was collected illegally.
External intelligence agencies would be kind of an exemption. But not in the case of the CIA, as they give information to internal intelligence agencies, although they shouldn't, at least by the law.