There is nothing to say the market won't solve problems. Innovations like Gilead's are inevitable. A cure might make less money than chronic treatment, but once a cure exists nobody is buying the treatment. It's rational to develop the cure if you want returns.
All possible pharmaceutical innovations are not "inevitable", at least not in any given time frame. It may be that pharma companies know which R&D approaches have a chance of producing a permanent cure, and which ones are more likely to result in a chronic treatment, and they focus their efforts on the former.
If your ultimate goal is sustainable profit, it would be rational to not even look for a cure at all.
As long as there is no practically usable permanent cure, everyone has a stable source of revenue from chronic treatment solutions.
Once anyone develops one, the chronic treatment would become significantly less attractive (as you say), so revenue would become less predictable for all parties, including the party that developed the cure.
It's enough if you already have a sustainable business selling chronic treatments. Which I think would be likely for the kind of companies that have enough resources to be able to research a permanent cure at all.