This shloka completes the thought from 17.5. Krishna says: those senseless people who torture the body — which is made of the five elements — and in doing so also torment Me, who dwells within that body, know them to be of demonic resolve.
The statement carries a striking weight. Krishna is not merely saying that reckless austerity harms the body. He is saying it harms the divine presence within. The body is a temple. To break it through foolish stubbornness is not devotion — it is an act against the very God one claims to worship.
This does not mean austerity should be avoided. It means austerity must be guided by wisdom and aligned with scripture. The path to inner purification runs through understanding, not through self-inflicted suffering.