I think this is just due to the distinction between how scalar field are used in cosmology (where they are assumed to depend only on time) and the more general solutions (superpositions of plane waves, with spatial dependence) that would correspond to a massless Bose gas.
The stress-energy tensor for a massless scalar field is
$$
T_{ab} = \nabla_a \phi \nabla_b \phi - \frac{1}{2} g_{ab} \nabla_c \phi \nabla^c \phi.
$$
Now, if we're talking about some kind of quintessence field or a scalar to drive inflation, then we usually assume that $\phi$ depends only on some cosmic clock coordinate $t$, which is timelike. The stress-energy tensor then becomes
$$
T_{tt} = T_{xx} = T_{yy} = T_{zz} = \frac{1}{2} \dot{\phi}^2
$$
and so we can identify $\rho = P$. Hence, $w = 1$ under this assumption.
However, if we allow $\phi$ to have behavior that's any more complicated than this, then the stress-energy tensor has a much more complicated form, and can't be interpreted as a perfect fluid any more. Even a simple plane-wave solution can't be interpreted as a perfect fluid any more: if $\phi = f(x - t)$, then we have
$$
\nabla_\mu \phi = (-f', f', 0, 0).
$$
This then leads to the fact that $\nabla_c \phi \nabla^c \phi = 0$ (which makes sense, since the propagation direction is a null direction.) Thus, we have
$$
T_{tt} = T_{xx} = -T_{tx} = (f')^2,
$$
which is not in the form of an isotropic perfect fluid: there are off-diagonal components, and the pressure is anisotropic.
Hopefully this convinces you that at the very least, you shouldn't expect a general solution for a massless scalar field to have $w = 1$. It's much more involved to show rigorously how you actually do get the equation of state for a Bose gas ($P = \rho/3$) if you take a general superposition of plane waves. If I have time later, I'll come back and add this in; however, here's a hand-waving sketch that will hopefully convince you:
First, we suppose that the stress-energy of a superposition of plane waves is equal to the sum of the stress-energy of each plane wave. This is not obvious, since the stress-energy is quadratic in $\phi$, not linear; but I believe it follows if you use a basis for your plane-wave solutions that has some nice orthogonality properties (like monochromatic plane waves, for example), and if you average over sufficiently large spatial volumes.
Next, we assume that our Bose gas is isotropic. This means that for every contribution to $T_{ab}$ from a wave traveling in the $+x$-direction, there will be a plane wave of equal amplitude traveling in the $-x$-direction as well. It's not too hard to see that the off-diagonal contribution from a plane wave of the form $e^{i(t-x)}$ will be exactly cancelled by the off-diagonal contribution from a plane wave of the form $e^{i(t+x)}$. (Try putting $\phi = f(t+x)$ in the plane wave derivation above and see what happens.)
Thus, each monochromatic plane wave contributes a certain amount of energy density to the stress-energy tensor, and the same amount of pressure to one of the space-space components. But if we assume that we have an isotropic distribution of plane waves, then there will be equal contributions to the $xx$-, $yy$-, and $zz$-components of $T_{ab}$. For all three of these directions, the plane waves that contributed to them will have contributed that same amount to $T_{tt}$. Thus, we must have $T_{tt} = 3 T_{xx} = 3 T_{yy} = 3 T_{zz}$, or $P = \rho/3$.