It will pass through, eventually
How does the sphere work?
You might imagine the sphere immediately cutting holes through anything it touches - or as Novak says "Swiss cheesing an object". But nothing in its description refers to it actually making a hole in anything - and this is different from, for example, the description of the passwall spell, which explicitly does describe how it makes a hole in objects.
Rather, the sphere can touch an object or a creature, causing damage. It can also 'obliterate matter'. Unfortunately, we are not told under what circumstances it does one or the other.
Deducing how the sphere works
A creature whose space the sphere enters must succeed on a DC 13 Dexterity saving throw or be touched by it, taking 4d10 force damage.
If it doesn't touch you, you don't take damage. It damages only creatures it touches. If it does touch you, you take 4d10 - but you don't end up with a hole in your body.
The sphere obliterates all matter it passes through and all matter that passes through it...Anything [except an artefact] that touches the sphere but isn't wholly engulfed and obliterated by it takes 4d10 force damage.
In 5e, objects automatically fail Dex saves. So if the sphere is directed at an object, it will touch it, and it will do damage - unless the sphere simply obliterates the object. Some things - objects which can be engulfed - we know are automatically obliterated. But if the object is too big to be engulfed - that is, if it bigger than the sphere itself - how do we know whether it will be damaged, or obliterated? The description tells us that anything that is not obliterated is damaged, but it doesn't explicitly tell us what the rule is for when larger objects are damaged and when they are instead obliterated.
We know what the rule is not, though. It is not simply that anything it touches is obliterated. It cannot be that any matter that comes in contact with the sphere is obliterated. We know this because the description specifically says that anything that touches the sphere (and is not obliterated) takes damage - so it must be possible for things to touch it and remain intact but damaged - just like creatures can. If the sphere simply destroyed any matter it touched, for example carving a hole of its size through a wall, we would not need to know how much damage it did when it touched something but did not destroy that thing.
Suppose the sphere entered the space of an object smaller than it - the sphere could either avoid it, or it could engulf and obliterate the object without doing damage.
Now suppose the sphere enters the space of an object so large that it blocks the sphere's progress. The sphere cannot go through the space without passing through the other object. Here is our test - does the sphere damage the object, or obliterate it? We know that it damages things only when it does not obliterate them, and that it obliterates them when it passes through them. Hence if it automatically passes through the object and obliterates it, we did not need rules for damage. But if we use the rules for damage, the sphere must not have passed through the object (yet).
In this case, it seems to me that the purpose of saying that the sphere sometimes damages objects is to know when it has damaged an object enough to be able to pass through, and thus obliterate it. This is because the DMG specifically says that object hp (unlike creature hp) are a measure of an object's structural integrity. If the large object still has structural integrity (hp) after being touched, then it is still capable of restricting the sphere's movement and the sphere can't yet pass through it.
The DMG, in its section on rules for objects (247), says:
An object's hit points measure how much damage it can take before losing structural integrity. Resilient objects have more hit points than fragile ones. Large objects also tend to have more hit points than small ones, unless breaking a small part of the object is just as effective as breaking the whole thing. The Object Hit Points table provides suggested hit points for fragile and resilient objects that are Large or smaller...If you track hit points for [a Huge or Gargantuan] object, divide it into Large or smaller sections, and track each section's hit points separately.
Narrating an interaction with a large stone slab
The first time the sphere is run into the slab, it will do 4d10 damage. If that is more than is needed for a Large section of the slab to lose structural integrity, then the sphere will pass through the slab and thus obliterate a Large section of it. But if the damage is not enough to destroy that section, then the sphere cannot pass through the slab and will damage but not obliterate it.
Let's assume that the sphere will take two strikes to destroy a 10 foot cubic section of the slab (since the average of 4d10 is 22, which is less than 27, the suggested hp for a Large, resilient objects).
Narratively, you could describe this as the sphere hitting the slab once and bouncing off - its movement is halted but huge cracks appear in the slab. The next time the sphere impacts the slab, the rock shatters and a 10' x 10' x 10' section of the slab is completely obliterated from existence as the sphere passes through the gap it creates - much like a disintegrate spell, if used against a Huge or larger object, will destroy a 10' cubic section.
Or, if you wanted to preserve the sense of the sphere moving inexorably forward, but still using the same process of damage rolls against object hp, you could narratively describe it as the sphere's motion slowing as it rips its way through the slab. All along its route, rock is cracking, calving off, and falling into the sphere, whereupon the pieces vanish from existence. The sphere is slowly cutting a roughly ten by ten hole through the rock, with what remains behind rough edges of raw stone.
These descriptions are based on my interpretation that when the sphere says it
obliterates all matter it passes through and all matter that passes through it
it means that 'all matter that passes through it' is everything that goes inside the sphere, and 'all matter it passes through' is the rest of the object outside the sphere. If it is passing through 'the slab', then it must obliterate 'the slab'.
One could, instead, interpret the 'passing through' to indicate relative motion rather than inside and outside. That is, 'all matter that passes through it' is things that are moving while the sphere is stationary and 'all matter it passes through' is the matter that goes inside the sphere when it is the sphere that is moving. This may be the interpretation that @Novak is using, which could be the source of some of our disagreement. With this interpretation, the matter obliterated would indeed be the size of the sphere, only, and not the larger surrounding object. However, given that it still either damages or obliterates, not both, I think what would happen in this case would be that the sphere would hit the slab but be unable to penetrate it until it had done enough damage to compromise its structural integrity. Once the relevant section of the slab had been reduced to 0hp, the sphere would indeed carve a perfect tunnel through the rock, but the part not carved out would immediately collapse into rubble around it. That is, it would not leave a clean hole through an otherwise intact wall.