Firstly, "therapeutic radiotherapy"? Therapeutic radiology, yes. Radiotherapy, yes. Is there a non-therapeutic radiotherapy? :)
In answer to your question, I presume that you are reading about the physics of artifically generated external beams (explanation later).
The artificial photon beam are doing two things. Firstly it is diverging and so the intensity reduces according to the inverse square law as you describe. Secondly, it is travelling through material so it is being absorbed also - BUT remember that the beam you are dealing with has a spectrum of photons of varying energies and that lower energy photons have a shorter HVL for any material, so absorption occurs preferentially, so as you go deeper, the remaining photons are more energetic and so the expected depth dose percent is off by a small amount because the beam has been hardened.
If this is true, the effect will not be seen with a cobalt beam which is monoenergetic and so not subject to hardening only attenuation.
How does this work?
A