The random introduction of a cavalry unit into an infantry line is IMO jarring, unrealistic, and bad for gameplay. Jarring: I already talked about this at length, but suffice to say that infantry - infantry - mounted + reasource - infantry - helicopter + resources is just goofy. This is compounded by the fact that spears and pikes aren't just anti-cavalry. They're also the non-warmonger path/no iron frontline soldier/meatshield/defensive bonus unit. So the Lancer keeps the Pikeman's bonus, but not a large part of its role. Unrealistic: it breaks immersion and makes it feel very "gamey", which is bad when there are good, easy, non-gamey ways of doing it (gameplay > realism, yes, but this isn't a case where one has to be sacrificed for the other). Bad for gameplay: putting a unit with a resource requirement in the middle of an upgrade path. Ever seen a city-state ally get before you can show up to save it because it has a huge army of pikes it can't upgrade going up against WWII infantry? I see it all the time. There's also the problem that a couple techs after Metallurgy lancers are pretty much useless , anti-tanks aren't that great, and as it stands Gunships are a joke. So no, the fact that one unit with a mounted bonus upgrades into another unit with a mounted bonus does not make it a good or reasonable system.
Alternative: I already proposed one – multiple upgrade paths – which would solve a lot if the problems and is something the game should have anyways (along with a greater range of units, but I digress). But a second alternative would be to introduce another unit that represents mixed-arms forces like the Tercio. In fact, just give Spain a different UU and make that unit, probably with a more generic name, a representation of the musket-pike formations proved to counter cavalry beautifully in the early days of gunpowder. I actually don't see where it could go other than on Gunpowder or Metallurgy (that doesn't make much sense though), and you don't want them to overshadow/overpower muskets, so you'd want to reduce the combat strength somewhat from the Tercio's. But that would pretty much solve the entire set of problems. Pikes get an upgrade that maintains all ther roles, not just one of several like Vanilla and G&K, which just swapped which part of their role they held onto. We don't have a random speed ramp up and resource requirement followed by going straight back (and then back AGAIN). Lancers can be made into a more standard cavalry unit – maybe with the anti-cavalry bonus, maybe not – and put on the Knight-Cavalry path. As it is, Civs with a Lancer UU have to suffer through upgrading from a meh unit, and upgrading into an even more meh unit, and being of very limited use the whole time anyways. And there's just a huge gap between Knights and Cavalry, which this would help fill. It just seems so sensible and simple to me, since it uses a unit that already exists as its template, that it kind of boggles me that they went with the system they did.