It's a way more complicated story, and it's important to disambiguate between "CDMA" the standard and "CDMA" the channel access method.
The core issue was that in the 2G era, "CDMA" (the Qualcomm name for IS-95/IS-2000) was built on CDMA (code division multiple access), while GSM was built on TSMA (time division multiple access). CDMA (the channel access method) is more spectrum efficient than TDMA, and has some other nice properties. When the time came for carriers in many countries to deploy their 2G networks, it seemed like a win to use CDMA (the standard) because they could support more subscribers with the same amount of spectrum. Companies other than Qualcomm did make CDMA chips in this era.
In the 3G era, the GSM standard also moved onto CDMA ("UMTS"). But this was a pretty serious migration effort, so carriers that had already deployed IS-95/CDMA typically moved along to the 3G variant of CDMA (IS-2000), which required buying less new equipment.
As the 4G networks starting showing up, Qualcomm saw the writing on the wall so they (a) got on the GSM/LTE bandwagon and (b) started investing heavily in their SoCs, which could be bundled with their basebands for smartphones. Since they happened to also be the only remaining baseband manufacturer that was making CDMA support, they also had a tremendous selling point: use our chips in your smartphones and you can still support 2G/3G CDMA networks, which at this point were widely deployed. Plus Qualcomm has so many patents on LTE that you're probably going to end up paying them quite a bit of money even if you don't buy their chips. So today even companies like Samsung which make their own SoCs make variants of their phones with Qualcomm chips to support CDMA carriers.
Qualcomm fans/employees will often mention that this really all goes back to the 80s/90s, when Europe forced everyone to use GSM (which just so happened to be hugely reliant on Europe-owned patents). CDMA never really got a fair shake at world domination. Perhaps if the FCC had just picked one cell phone standard (perhaps CDMA) like they did for TV and radio things would have worked out differently. China briefly tried coming up with their own cell standard (TD-SCDMA) for similarly protectionist reasons and it didn't really work out.
As it is...well, the world finally ended up settling on LTE.