They're supposed to cater to customer demand. Supply/Demand. Simple free market economics. Shareholders shouldn't even enter the equation since they're not the customers.
Either that or everything I was taught in Economics 101 was a lie...
Shareholders are usually the main investors in a company, and if they don't see a return on their investment $$$, they ain't going to invest, and therefore no company. Where I am, telcos like China Mobile, the investor and shareholder is the government. And if there's any losses on govt investments in state-owned enterprises, it comes out of taxes.
Yeah, supply/demand. But if the demand is dwindling, e.g. a few holdouts that are still using Java phones. It can become uneconomic for private telcos to pay for and maintain legacy network infrastructure. Unless they have a govt or legal obligation to keep old infrastructure running.