This is true for (free) massless particles only and derives from the invariance of the action under scaling transformations. Take, as an example, a massless scalar field (in for simplicity special relativity). The Lagrangian is
$$\mathcal{L}=\frac{1}{2} (\partial_{\mu} \phi) (\partial^{\mu} \phi).$$
The action is obviously invariant under the scaling transformation
$$x \rightarrow \lambda x, \quad \phi \rightarrow \frac{1}{\lambda} \phi,$$
because then
$$\mathcal{L} \rightarrow \lambda^{-4} \mathcal{L}, \quad \mathrm{d}^4 x=\lambda^4 \mathrm{d}^4 x.$$
Using Noether's theorem you can show that the corresponding Noether current leads to
$${\Theta^{\mu}}_{\mu}=0,$$
i.e., the vanishing of the (covariant) trace of the canonical energy-momentum tensor.
Another way to directly verify this is to calculate pressure and energy density of an ideal gas of massless particles. The energy-momentum tensor is given by
$$\Theta^{\mu \nu}(x) = g\int_{\mathbb{R}^3} \frac{\mathrm{d}^3 \vec{p}}{(2 \pi \hbar)^3} \frac{p^{\mu} p^{\mu}}{p^0} f_{\text{B/F}}(p^0), \quad p^0=\sqrt{m^2+\vec{p}^2}.$$
Here, ##f_{\text{B/F}}## is the Bose or Fermi distribution, and ##g## some degeneracy factor counting intrinsic discrete quantum numbers like spin, isospin, flavor, color and the like.
Since in this integral the particles are always on their mass shell, for ##m=0## you get indeed ##{\Theta^{\mu}}_{\nu}=0## because of ##p_{\mu} p^{\mu}=m^2=0##.