The U.S. Court of Appeals for the Second Circuit affirmed Tuesday that the federal government must justify the incarceration of certain immigrants subject to deportation proceedings by showing that they are either a flight risk or a danger to the community.