A quick Google search reveals that different sources suggest data centers are responsible for something between 0.2% and 3% of global CO2 emissions. (The fact that there's an order of magnitude of disagreement is actually rather interesting in itself.)
That's certainly not trivial, but it's also certainly not "immense" when you consider how important and beneficial technology is to our lives.
Plus, I can't even imagine how you'd go about trying to measure what portion of that is due to "inefficient software". Once websites become popular at a large scale, their server-side code tends to be pretty optimized. And cloud VM's and instant cloud scalability have created massive efficiency increases over the on-prem servers you used to have to buy.
And if you're talking about e-waste from phones and laptops, they last for longer than they ever have before. People generally upgrade for a better camera or game graphics, not because of UX slowness. Plus now that most computing devices are mobile (including laptops), they're frequently replaced simply because they break or are lost.
Not my experience. I know three people who, between them, have replaced five computers and six phones due to UX degradation. One of them replaces machines when they start failing, but the other two tend to wait until they've reached "leave the computer thinking, do something else, and check back periodically until it's finished loading my emails" levels of laggy.
Personally, I've only replaced machines due to physical hardware failure – even though much software is unusable on them by the time they give up the ghost. (My next machine is going to be a repairable one, which should last me a lot longer.) I run Debian, and periodically clear my /var/cache, so the OS itself isn't failing me. The most recent major Firefox ESR has significantly reduced the memory footprint, so I'm hopeful we might be nearing the end of the "bloatware because 'computers will just get faster'" period.
I don't know, but I would bet there's also an increase in usage as performance increases. When software is fast you use it more frequently and for more things.
I'll bet if you calculated the carbon "cost" of a human life and did the math on the wasted human time it would be higher than the incremental electricity cost of the datacenter or amortized manufacturing cost of the phone or whatever else you're worried about. But I feel much worse about the wasted life for its own sake, personally.
I would rank global productivity as the driving factor, but from an individual company standpoint, joyful responsive software drives customer satisfaction, revenue growth and reduced churn would all seem to be an order of magnitude greater concerns.
Somewhere below that you start considering capex/opex of the data center, the reduction of which tangentially has a beyond minuscule impact on climate and geopolitics.
In all seriousness though, the tech industry is an immense contributor to global warming because of inefficient software which uses large quantities of energy and necessitates the creation of massive quantities of e-waste as older machines are unable to provide an adequate user experience for extremely computationally heavy designs.
Extremely inefficient software which is necessary for everyday tasks also means only the latest hardware from China/Taiwan is competitive. Bad software is a geopolitical and national security risk.