Actually, many smartphones are pretty expensive, you just don't see the actual cost because most US carriers are obfuscating the price into their plan subsidies.
The exception is T-mobile. You will see that last year's top tier smartphones like Galaxy S5 and LG G3 were in the $600 range, not cheap by any means if you are going to upgrade every year.
In comparison, you can buy a $600 laptop or desktop computer, and keep it many years, and get security updates for the OS you choose to install on it on it from the OS vendor for many years. But there is no such choice on a mobile phone, you are typically locked to the OS that came with it, and can only obtain updates for it from the device maker or the carrier.
You can't generally just wipe the OS on your old device and install another OS on it that supports hat old device, and still gets regular security updates.
There are some mods like Cyanogenmod, but first you need to root your device.
Generally, rooting is done by first exploiting one of the many unfixed security vulnerabilities in the OS ;).
But even after that, the modded OS tends to have a lot of issues on many devices, as they are not tested by the developers on all available devices.
And unlike a PC, the base hardware between phones varies much more, so you can't get a single base OS image to work for all smartphones like you can, say, have a single Windows or Linux CD/DVD install that can be installed on all PCs.