Depending on gold supply, I occaisonally upgrade my guys. Not too often though. A spearman can be individually effective up to cavalry (if you got them on a mountain with fortress bonuses).
I've used a force of fifteen spearmen as cannon fodder once, they delayed six German panzers from taking a valley into one of my key cities. (Why did i have fifteen spearmen in the industrial age? Spendin all my cash on science.. so that my spearmen would feel even more unloved that they aren't getting the gadgets)
Spearmen also make very good pillagers, I like to send them in a galleon and drop them on a saltpeter resource in the middle ages (timing being critical, they should have just got gunpowder). A couple of spears can hold off enemy knights on that resource (after they pillage) for a few turns, specially if on a hill. Thats enough time for me to plow through their lack of musketmen with a concentrated group of knights.
And like most people, in the deep core of my empire where an invasion will never reach, I have spearmen drilling among my factories and skyscrapers. Gold sometimes can be better spent on rushing an improvement or science then upgrading a useless deep reserve force.
As for swordies, they are non upgradable (unless you fiddle in the editor), but I can't bring myself to disband a perfectly good fighting unit. They are useful as cavalry killers, without risking more quality offensive/defensive units (after a defense of a city the fast units often need to be chased down). Also an elite swordsmen against just about anything with only one hit point, there is a fairly decent chance the sword will get through. So if I still have some I keep them with my offensive force, because the sheer numbers I throw at the enemy every once in a while results in needing that one last rifleman hit point to be taken off to grab the city.
By the modern era though, when some units can attack twice, planes can fly over em, nukes start flying, by then I pretty much don't keep my swords or spears around for any tactical purposes.