This formula makes sense for low pass signals, i.e., for signals with a spectrum centered around $\omega_0=0$. The bandwidth of low pass signals is defined as the support of their spectrum at *positive* frequencies. So your integration limits must be $-B$ and $B$. This results in $$B^2_{rms}=\frac{\int_{-B}^{B}f^2df}{\int_{-B}^Bdf}=\frac{2B^3/3}{2B}=\frac{B^2}{3}$$ which is the expression that you're looking for.