A federal appeals court ruled on Friday that the city of Fremont can legally enforce its immigration ordinance.