They're essentially a scheme to collect cash in advance and reap unspent cards, right? I don't know why anyone ever thought they made more sense than cash.
The "ensure they use it" is the part that is uncertain, and thus the 'scam' aspect. Amazon (and other vendors) are betting that a significant percentage of end users will not actually use it, and the seller will get to keep the entire balance as profit.
According to some not-very-thorough queries, somewhere from 10–19% of gift cards are never redeemed in the USA, which equates to tens of billions of dollars. Unreal. If even half of that is true, that's a tremendous amount of charity to corporations.