Microsoft account balance can be used to purchase Xbox-related subscriptions, including Xbox Game Pass, after redeeming a Microsoft gift card to the account.
However, when redeeming or using offers (for example, promotional Game Pass codes), the system may still ask to add a backup payment method (such as a debit/credit card or PayPal) for future recurring billing, even if there is enough Microsoft balance. This backup method requirement cannot be bypassed where enforced.
To add money first, redeem a Microsoft gift card to the account on the Redeem page, then use that balance toward an Xbox Game Pass subscription.
References: