Same concept as an unstoppable force meeting an immovable object, which is to say, they would be the exception to each other.
The spear can pierce any material, so the shield will indeed be pierced, but only slightly. Because the shield will be holding up it's end too, and blocking the spear from going too deep through the shield's surface.
So on the one hand the spear went through, but not as much as against others. On the other, the shield did block the attack, just not as well as it would've against others.