Governments can pass laws that make it illegal to mine bitcoins.
Why woud they want to do that?
Once mining becomes unprofitable, there is no point in outlawing it.
While mining is still profitable, it adds to the bitcoin supply and hence lowers the value of coins in people's wallets. You get bitcoin inflation, just as governments printing causes inflation of ordnary currencies. This will make bitcoin less attractive.
Moreover, the government will profit by taxing the miners' income.