CoreCivic has sold two of the largest immigration detention facilities in California to the U.S. Department of Homeland Security — one of which is located in California City, the company said Monday.