It is not necessary to suppose an infinite-size bag for the teacher's answer to be correct.

Consider a simplified version of the problem: Suppose candies come in two colors, Blue and Red, with equal probabilities, and suppose the bag contains two candies. If the first candy drawn is Blue, what is the probability that the second is Blue?

If we list the colors in the order (first, second), the initial contents of the bag are one of (B,B), (B,R), (R,B), and (R,R), all with probability 1/4. If the first drawn is Blue, then the possibilities are (R,B) and (R,R), each with probability 1/2. So the probability that the second candy drawn is Blue, given that the first is Blue, is

which is the same as the unconditional probability that the second drawn is Blue.