When you buy someone a gift card you are limiting how someone can spend that cash. This transaction has converted your money that before was valid at all stores to money that now is only valid only at a single store. If the person you gifted the card to doesn’t want to use it at that store, their only option is to give it to someone or convert it to cash via an online gift card exchange, who will probably charge them at least 12% of the cards value for their invaluable services.
Companies are quite happy to sell you a gift card because it’s a free loan that someone might be redeemed at some point in the future, but the company gets to use now for anything they’d like. On top of the free loan, your giftee could forget to redeem all or part of the balance on the gift card and the temporary free short term loan could become a permanent loan that you kindly transferred to your giftee that they will never get back. On top of this newfound responsibility, your giftee has to make a special trip to the store where this store of money is valid to get the value of your gift.
If you want to give someone a gift and they happen to like Starbucks, consider giving them cash and then they get to decide if they want to use it to buy Starbucks or if they want to save it for a rainy day, buy coffee from the grocery store, or invest it in Starbucks stock and buy a few cups of coffee with that money every year for the rest of their lives. You care about the person enough to give them a gift, try to maximize their freedom to best use your gift. You’ll both end up happier.