Normally, one would attempt to factor all expressions to simplify a rational expression. But in the case of a substitution one might be eliminating the value which makes the expression undefined, that is , a 0 denominator.
If you factor the numerator you get [(x-3)(x+1)]/(x-3). Since we are asked to find the value of the expression at x = -2, we can reduce the expression and obtain x+1. At x = -2 we have [(-2) + 1] = -1
If we were asked to evaluate at x = 3, we could not factor, reduce and get 4 because the expression is not defined at x = 3.