If you are deriving the formula for a spherical shell -- not a thin spherical shell, but a spherical shell that has an inner radius [itex] a [/itex] and an outer radius [itex] b [/itex] -- then yes you would integrate over [itex] r [/itex] from [itex] a [/itex] to [itex] b [/itex]. The moment of intertia would not be a function of a [itex] r [/itex] but instead would be a function of [itex] a [/itex] and [itex] b [/itex]. In that case a triple integral would be involved.It is thin but it is not infinitesimally thin. It is a real object. It is thin enough that the integrand does not change much over the thickness making the integral in the third dimension trivial, but the third dimension must be included.
As Jake discovered
dI of solid sphere =r²dm
Except the first r is the radial distance from the axis and should be r sin(phi)
that is the correct reasoning and the correct integrand with the correct infinitesimal piece of volume. Now answer me this: does the correct moment of inertia for a thin sphere have “dr” in the expression, or does it have thickness? It has thickness. Why? Because that is what dr INTEGRATES to! Yes, you absolutely DO have to integrate in all three dimensions. The fact that the sphere is thin means that the radial integral is trivial, but it is there
\int_r1^r2 dr\ = r2-r1 = thickness
But the problem statement specifically stated "thin" spherical shell, implying that the thickenss between [itex] a [/itex] and [itex] b [/itex] is negligible. In such a case, the moment of inertia is a function of the radius [itex] r [/itex]. Only a double integral is necessary. No [itex] dr [/itex] is involved.