Yes, the spears are crucial - note that I'm responding to the idea that the horse couldn't get through the interlocked shields. Whether or not it would be smart for them to try is a separate question, with an answer dependent upon the situation. All I'm saying is that interlocked shields alone don't stop cavalry.
Yes, however, now you are perhaps assuming an optimal arrangement for the defender. Rarely in history has anything been optimal for anyone in a war, or at least not for long.
A battlefield is a dynamic place - you have blocks and lines of footmen, bodies of archers, and wings of horse all moving around, jockeying for position. It is suicide for the cavalry to wash against a real mass of footmen, but the footmen don't get to choose to stand there in a still block and wait for the horses, because the archers are busy pelting the footmen, and so on.
End result, you will occasionally get vulnerable spots, where there are insufficient footmen to be secure against cavalry charge, even if they have a shield wall. You'll also get cavalry charging at footmen who occasionally have more backup than originally expected, and so on.