So, bear with me because I'm sure there's going to be some major historical misunderstandings on my part as to the reason why I don't understand this. So, I'm aware real combat isent this "rock, paper scissors" but from what I understand, shield walls are fairly effective against projectiles but can be broken by calvary, while spear walls/squares are the opposite. What was stopping soldiers in the medieval/antiquity from using both spear and shield to deal with both possible outcomes? Large shield and spear. Would it just be too impossible to form tight enough to create an effectuent Shield walls if they also have the spear? Could a cut out in the side of the shield solve this problem like you sometimes see in circular shields?
I apologize if I'm misunderstanding you, but I think the problem here is that you assume that a shield wall and a "spear wall" (honestly never heard that term) are radically different concepts. Shield wall is just a term people use to refer to a reasonably dense (say, three to five feet per man - too dense and you can't fight effectively) heavy infantry formation which is effective against cavalry, infantry, and archers. It's very, very similar in form and function to a phalanx or a pike square or whatever you want to call it. Most of the time, the soldiers involved were equipped primarily with some variety of spears and shields. It's the same basic principle, regardless of if you use a spear or a pike.
In my own area (France and England, 1000-1200 ish) heavy infantry primarily functioned as a holding force. The infantry, drawn up in dense but somewhat immobile formations, formed a barrier between the cavalry and archers and the enemy army, protecting them and enabling them to maneuver for decisive results. This is essentially what Alexander's phalangites did, and it's not awfully different from what early modern pikemen would do. That's not to say that infantry didn't engage the enemy directly; they certainly did so; but cavalry more often was the decisive arm.