From the Player's Basic Rules, page 71 (or PHB p. 191):
In contrast, you can move through a hostile creature's space only if the creature is two sizes larger or two sizes smaller than you.
An ogre is a large creature and elves are medium. So an ogre can't move through an elf's space. In your previous example, if we have a 10-foot wide passageway with two elves standing side by side, the ogre can't get through without killing one of the elves or forcing them to move.
The rules on squeezing into a smaller space are for an ogre trying to move along a 5 foot corridor. The rules on creature size that you've quoted back this up—the ogre isn't actually 10 feet wide, that's just the space he controls. So he can move through a 5 foot wide gap, but it's cramped and he can't move freely.
Now, you might be thinking that it's a bit unfair on the ogre if the 2 elves can form an impenetrable barrier against it. As you've said, he'd rather shove them aside than squeeze between them. And he can do just that! From the Player's Basic Rules, page 74:
Using the Attack action, you can make a special melee attack to shove a creature, either to knock it prone or push it away from you. If you're able to make multiple attacks with the Attack action, this attack replaces one of them.
The target of your shove must be no more than one size larger than you, and it must be within your reach. You must make a Strength(Athletics) check contested by the target's Strength(Athletics) or Dexterity(Acrobatics) check (the target chooses the ability to use). If you win the contest, you either knock the target prone or push it 5 feet away from you.
So you're right, shoving is the ogre's answer here.
Now, with your new example, (2 elves in a 15 foot corridor with a 5 foot gape between them), things are different. The ogre does indeed have to squeeze between them. Fortunately for him, it's not going to matter all that much.
Why? Because he's almost guaranteed to be moving on his own turn. Unless there are more enemies than just the elves, he's not going to provoke any opportunity attacks while squeezing, and he can attack before or after he squeezes. So the only squeezing penalty that is actually going to apply to him in this situation is the double cost for movement.
Note that if he stopped between the elves, all these penalties would apply to him. That makes sense though—standing between two enemies with not enough space to move around in would make it difficult to dodge attacks or attack effectively.
In this case the range is probably measured from the hand itself
Normally, when you cast a spell that targets a location or creature that range is measured from the person who cast the spell. However there are exceptions.
Jeremy Crawford alludes to this in the following tweet:
Q: Call Lightning spell: on subsequent turns the point you chose must be within 120 feet from the point you chose for the cloud or a point within 120 feet from you? My doubt is born because, on susequent turns, you can move and go away from the fixed cloud above you
A: Call lightning is an odd spell because its range is measured from the effect it creates—the storm cloud—not from the caster.
Call lightning says:
When you cast the spell, choose a point you can see within range. A bolt of lightning flashes down from the cloud to that point. [...] On each of your turns until the spell ends, you can use your action to call down lightning in this way again, targeting the same point or a different one.
Which seems fairly similar to Maximilian’s Earthen Grasp which says:
You choose a 5-foot-square unoccupied space on the ground that you can see within range. A Medium hand made from compacted soil rises there and reaches for one creature you can see within 5 feet of it. [...] As an action, you can cause the hand to reach for a different creature or to move to a different unoccupied space within range.
Both spells create an effect which the spell allows to be moved on subsequent turns to target another creature/area.
If we follow Jeremy Crawford's ruling, I see no reason why Maximilian’s Earthen Grasp would not then follow the same ruling as Call lightning.
Thus, the range mentioned in the spell would be measured from the hand itself on every subsequent turn after the caster casts it.
So, as an action, the caster can move the hand up to 30 ft from the hand's current position (sort of like the hand had a move speed of 30 feet).
Best Answer
I would rule that the hand's space is difficult terrain
The relevant part of the spell text for Maximilian’s Earthen Grasp says:
(The rest of the spell text just deals with what the hand can do, not what space it occupies, so it is not relevant here.)
The spell doesn't explicitly say whether or to what degree the hand impedes creatures attempting to move through its space, so we have to make a ruling based on just this text. As it is, we know that the hand is made from compacted soil and is medium-sized. If we forget about the fact that it is animated for a moment, I would say a 5-foot-tall stationary sculpture of a hand made from compacted soil would be enough of an impediment to turn that space into difficult terrain. Animating that hand isn't going to make it any easier to get past, so I would likewise rule that the hand's space is difficult terrain. The extra movement spent moving through its space represents the creature needing to clamber up over it or squeeze around the side in order to get past it (similar to the rules for squeezing).
More generally, my answer is that the DM should make a ruling based on the physical description of the hand provided in the spell. I've made a case for difficult terrain as an appropriate ruling, but you might rule otherwise.