First, check you're entering the code correctly. For example: try 0 instead of O, and I instead of l (lower case L).
Otherwise, there are several possible reasons you may find you're unable to redeem a Spotify Gift Card code to your account:
Your account was created through a discount promotion.
The country registered to your account isn’t the same as where the gift card was purchased.
Your account is a Premium for Family account. (Spotify gift cards are not redeemable for Premium for Family or in conjunction with other discounts and promotions).