When calculating the potential energy of an assembled sphere, for example gravitational binding energy for gravity or electrostatic energy of a sphere for the electric force, we usually start by calculating the potential energy required to bring the mass/charge that an infinitely thin shell has at a specific radius $r$ from infinity to that radius $r$. This procedure is then repeated for every shell by integrating from $0$ to the radius $R$ of the sphere.
Why would we not consider the change in potential energy for every spherical shell as the charges it consists of are getting closer to each other?
Edit: It seems my question is unclear, so I'll try to clarify what my confusion is about. Consider a shell at radius $r$ with mass $m_{shell} = 4 \pi r^2 \rho dr$. Taking this shell from infinity to $r$ is ascribed a change in potential of $$dU = - \frac{m_{shell} m_{inside}}{r}$$ But moving the shell from infinity to $r$ means we change the density of the shell from infinitesimally small to $\rho$, doesn't it? Shouldn't there be energy associated with that?