For the sake of clarity, I want to note that flux density and radiance are two different parameters. Radiance is the power per (projected) unit area per unit solid angle, and spectral radiance is the radiance per unit frequency; these are also known as the intensity and specific intensity, respectively. Flux density is the power per (projected) unit area per unit frequency. Flux density depends on the distance to the source, while radiance and spectral radiance are conserved along any particular path.
One way to see this is to consider that specific intensity is conserved. We then look at the following relation for flux density:
$$S_{\nu}=\int_{\mathrm{source}} I_{\nu}(\theta,\phi)\cos\theta\;\mathrm{d}\Omega$$
where $I_{\nu}(\theta,\phi)$ is the specific intensity. Now, if a source is farther away, the solid angle it covers is smaller; therefore, we integrate over a smaller region of the sky. The flux density is then correspondingly smaller.
As an example, say we have a small source far away with constant specific intensity across a circle in the sky. In this case, we can write the flux density as
$$S_{\nu}\simeq I_{\nu}\Omega$$
Using the small-angle approximation, the angular radius should scale approximately as $\theta\approx R/d$, with $R$ the physical radius and $d$ the distance to the source. The solid angle scales as $\Omega\sim\theta^2\propto d^{-2}$, so the flux density scales according to the inverse-square law, as you might expect.
As pela notes, this doesn't hold on cosmological scales, thanks to cosmological redshift decreasing photon energy and photon number per bin of frequency/wavelength.