Yes, each section of wall is considered to be an object.
DMG 246 implies that a wall is an object:
Use common sense when determining a character's success at damaging an object. Can a fighter cut through a section of a stone wall with a sword? No, the sword is likely to break before the wall does.
DMG 247 confirms that walls are objects, stating that castle walls count as objects:
Big objects such as castle walls often have extra resilience represented by a damage threshold.
Also, Daern's Instant Fortress has parts that are explicitly given HP (DMG 161):
The roof, the door, and the walls each have 100 hit points, immunity to damage from nonmagical weapons excluding siege weapons, and resistance to all other damage.
If the walls of these structures count as objects, then it makes sense that a cave wall would also count as an object for the purposes of spells, since the two things are similar. However, the DMG treats individual sections of walls as separate objects. While walls are objects, entire buildings are not (DMG 246):
For the purpose of these rules, an object is a discrete, inanimate item like a window, door, sword, book, table, chair, or stone, not a building or a vehicle that is composed of many other objects.
This falls under the "use common sense" clause of the first quote. In the case of the Instant Fortress, reducing one of the walls to 0 HP does not reduce the entire structure to dust, for instance.
Therefore, the DM gets to use their "common sense" to determine what happens when a portion of a wall is targeted. If a wizard casts True Polymorph on that cave wall, I, as a DM, would not rule that the entire cave complex (or the entire planet!) gets polymorphed--only a big chunk of it.
As you can see, the rules explicitly give the DM a lot of latitude on how PCs interact with their environment.