Appeals court rules against Obama immigration plan