But if it is better than cash and gold, why do some countries ask their public not to use it, instead of legalizing it?
It is legal almost everywhere.
The reason why it's not directly supported by most states is because they were hoping for a slow and clean transition to a cashless society, and BTC, without a third party, is quite different to what they were hoping for. It allows a digital currency which works without a centralised group controlling the transactions.
Gold gets mined and mined and mined.
Gold only gets mined until it's no longer worth mining. This means that if the value rises, it's worth putting in more effort to mine it, thus increasing the supply and regulating the value.
While gold's value is far from stable, there is some relevance in having a physical resource with a notable purpose. BTC users also shouldn't need to have an endorsement from rich people to support it.