Incorrect proof that all gauge theories are abelian

Consider a gauge field $W_\mu = W_\mu^{a} \tau_a$ where $\tau_a$ are the generators of the Lie algebra and $W_\mu^{a}$ just numbers. Then:

$$W^2 = W_\mu W^\mu = W_\mu^a\tau_a W^{\mu b} \tau_b = W_\mu^a\tau_a \tau_b W^{\mu b}$$

Meanwhile

$$W^2 = W^\mu W_\mu = W^{\mu b}\tau_b W_{\mu}^a \tau_a = W^{\mu b}\tau_b \tau_a W_{\mu}^a = W_{\mu}^a\tau_b \tau_a W^{\mu b}$$

Therefore:

$$W^2 - W^2 = W_{\mu}^a [ \tau_a,\tau_b]W^{\mu b} = 0$$

So $[ \tau_a,\tau_b]=0$ and all gauge groups are abelian.

Where's the mistake?

The mistake is that $W^a_\mu [\tau_a, \tau_b] W^{\mu b} = 0$ does not imply $[\tau_a, \tau_b] = 0$, this is true for any antisymmetric object $A_{ab}$.

In your example, you can see this in the following way:

Let $A_{ab}$ be antisymmetric: $A_{ab} = -A_{ba}$. Then:

\begin{align} W^a_\mu A_{ab} W^{\mu b} &= W^b_\mu A_{ba} W^{\mu a} \qquad (a\leftrightarrow b) \\ & = W^{b \mu} A_{ba} W^a_\mu \qquad \text{Raise/lower } \mu \\ & = W^a_\mu A_{ba} W^{b \mu} \qquad \text{Commute } W \\ & = -W^a_\mu A_{ab} W^{b \mu} \end{align}

So $W^a_\mu A_{ab} W^{\mu b} = 0$ for any antisymmetric $A_{ab}$.

This is really a more general fact from linear algebra: For vector $v$ and matrix $A$, $v^T A\ v = 0$ if A is antisymmetric.

No, one can only conclude that the symmetrization

$$[ \tau_a,\tau_b] + (a\leftrightarrow b)~=~0$$

is zero, which is indeed true because the commutator is antisymmetric.