There are some $A,B,C$'s for which is is NOT true that:
$A \cup C = B \cup C \implies A = B$.
For example, if $A,B \subseteq C$, but $A \neq B$, then $A \cup C = B \cup C = C$.
To see why your professor's proof works, consider this statement:
"If John knows everyone, then John knows Sally".
We do not need to argue that since John knows Sam, John knows Sally; and since John knows Tom, that John knows Sally; etc., some of which may not even be true (for example, none of the forgoing statements are true in and of themselves, as it is possible to imagine the case where John knows Tom, but John does not know anyone BUT Tom).
We merely need to observe that since, in particular, Sally is part of "everyone", we have: John knows Sally implies John knows Sally, which is always true.
A statement like: "For all (something), such-and-such involving (something) is true" is a shorthand way of saying:
For something A it is true AND
for something B it is true AND
for something C it is true AND...etc.
If the truth of the statement for "something X" implies the conclusion we are after, that is the only case we need.
Contrast this with a statement like:
If $A \cup C = B \cup C$, then $A = B$. Here, we DO have to consider the truth value of every statement involving the $C$ part, because if we find even ONE $C$ for which $A \cup C = B \cup C$ is true, but $A = B$ is false, we have:
true implies false, which is false.
It's a subtle distinction, but the range (which part of the statement it applies to) of the quantifier "for all" makes a BIG difference.