Well the ref has. The defender took out the French striker inside the área without going for the ball.
You are missing that if France win 2-1 and Hungary win then Germany and Portugal would have 3 points and Hungary would have 4
One Portugal goal, sends Portugal 1st. One France goal, sends Portugal 4th. One Germany goal, sends Portugal 3rd.