As far as I know, you can use it for whatever you like but you will lose the Government "bonus" if you don't use it all to put towards buying a home.
Help to Buy ISA is now being replaced by the Lifetime ISA which can also be used for a Pension and is open to everyone under 40.
I am not a financial advisor and would suggest you talk to providers for clarification.
In any event you are getting free money from the taxpayer and in some cases, much higher interest rates too.
If I were under 40, and saving to buy my first house, I would have one!