He taught against asceticism because the false teaching could lead people astray from true spiritual behavior.
Evidently there were people who were probably influenced by Greek philosophy that were teaching that to deny our fleshly desires, whether they were food, sex ot anything else, would make us more spiritual. Paul teaches that that is wrong because it can make some people think that if they can do that they are better than others.
But godliness with contentment is great gain, 7 for we brought nothing into the world, and3 we cannot take anything out of the world. 8 But if we have food and clothing, with these we will be content.
Simply denying the body normal bodily appetites may, at times, promote a certain kind of spirituality, or at least the perception of such, but is not in and of itself anything foundational or crucial to the Christian faith, and can actually lead people astray from true spiritual behavior.
Because we must fix our eyes on God and not earthly things that please us for the moment. When we focus on the earthly things and not seeing it as a blessing from God we loose sight on what we are doing.