Wien Bridge Oscillator: Why does equating the real part to 0 give the gain equation?
Because they're starting with the Barkhausen Criterion; loop gain = 1.  The loop gain is $$\left( 1 + \frac{R_3}{R_4} \right)\left(\frac{RC s}{(RC s)^2 + 3RCs + 1} \right)$$.
Everything else comes from setting that to one, and then doing some math.  Basically, they set that to one: $$\left( 1 + \frac{R_3}{R_4} \right)\left(\frac{RC s}{(RC s)^2 + 3RCs + 1} \right)$$
Then they make an equation where &quot;stuff = 0&quot;.  In order for &quot;stuff&quot; to be zero, then both it's imaginary and real parts have to be zero (not just one or the other).
It happens, conveniently, that in the circuit as shown, the real part depends on \$R\$, \$C\$, and the frequency of oscillation, \$\omega\$.  So setting it to zero finds you \$\omega\$ as a function of \$R\$ and \$C\$.
Again, conveniently, once you know the frequency of oscillation (because you set the real part to zero), \$R\$, \$C\$, and \$\omega\$ drop out of the equation and you can calculate the gain.
But it is not &quot;why can you just set the imaginary part to zero&quot;.  You have to set both the imaginary and the real parts to zero, then solve that system of two equations to get two unknowns.