It is necessary to add permission for margin trading in the following key:
To do this, click on the Edit restrictions button and check the Enable Margin (you can check on Futures too if you plan to trade there) and click Save.
Binance will request confirmation of action through 2FA. To do this, copy the code from the Google Authenticator application for your Binance account.
After confirmation, margin trading will be available.