Not trying to beat M. G., I would rather provide an elementary explanation of what's essentially going on, trying to convince you that what you've asked is really something one might expect.
Let $\nabla$ be a connection preserving the field of endomorphisms $J$, i. e. $\nabla_XJY = J\nabla_XY$, and $T$ be its torsion. If we change the connection, if would differ by a vector valued 2-tensor $A$ satisfying $A(X,JY) = JA(X,Y)$. The torsion $T'$ of the changed connection $\nabla'$ would be given by $T'(X,Y) = T(X,Y) + A(X,Y) - A(Y,X)$.
Suppose we want to come up with an expression in terms of torsion, which would be invariant w. r. t. adding a $J$-linear in its second entry tensor $A$ to the connection. One needs to find a nontrivial relation satisfied by the skew symmetric vector valued 2-tensor $$\alpha(X,Y) = A(X,Y) - A(Y,X),$$ which would give rise to an expression in terms of torsion depending on the field $J$ alone. This is straightforward:
$$\alpha(X,Y) = A(X,Y) - A(Y,X) = -JA(X,JY) + JA(Y,JX) = \\
= -J(\alpha(X,JY) + A(JY,X) - \alpha(Y,JX)-A(JX,Y)) = \\
= -J(\alpha(X,JY) + \alpha(JX,Y)) + A(JX,JY) - A(JY,JX) =\\
= -J(\alpha(X,JY) + \alpha(JX,Y)) + \alpha(JX,JY).$$
Hence the tensor $\alpha$ satisfies the formula $$\alpha(X,Y) + J\alpha(X,JY) + J\alpha(JX,Y) - \alpha(JX,JY) = 0,$$
and the corresponding expression involving torsion
$$\nu(X,Y) = T(X,Y) + JT(X,JY) + JT(JX,Y) - T(JX,JY)$$
is independent on the choice of the connection.
Let's write the tensor $\nu$ in terms of the connection.
$$\nu(X,Y) = \nabla_XY - \nabla_YX - [X,Y] + \\
+ J\nabla_XJY - J\nabla_{JY}X - J[X,JY] + \\
+ J\nabla_{JX}Y - J\nabla_YJX - J[JX,Y] - \\
- \nabla_{JX}JY + \nabla_{JY}JX + [JX,JY].$$
The connection terms cancel out as $\nabla_XY+J\nabla_XJY = 0$, $J\nabla_{JX}Y - \nabla_{JX}JY = 0$, $-\nabla_YX - J\nabla_YJX = 0$ and $-J\nabla_{JY}X + \nabla_{JY}JX = 0$. What rests is $$\nu(X,Y) = [JX,JY] - J[X,JY] - J[JX,Y] - [X,Y],$$ i. e. $\nu$ is the Nijenhuis tensor.