Multiplying Binomial Terms
It's not wrong. You just haven't noticed that $-x+2x = x$, so that, if you simplify, you get $$(x+2)(x-1) = x^2 -x + 2x - 2 = x^2 + x - 2.$$
The FOIL "rule" (First, Outer, Inner, Last) simply follows from the distributive laws:
$$k(m+n) = km + kn$$
$$(k+m)n = kn + mn$$
In your case,
$$ \begin{align} (x+2)(x-1) = x(x-1) + 2(x-1) = x^2 - x + 2x - 2 = x^2 + x - 2, \end{align} $$
as you have already noted.