It's up to the DM; however it could be quite reasonable to rule that the Erupting Earth spell could not be cast or would fail if it was cast on a "floor".
Note that this is in response specifically to the Erupting Earth spell found in XGtE, and not other spells found in the PHB that refer to "ground" - like Shapechange, Tsunami, Phantom Steed, Meteor Swarm.
While the rules in the PHB have not differentiated between "ground" and "floor", it can be seen in XGtE that the rules are now making a distinction between the two.
The description of the Snare spell indicates the following (emphasis mine):
As you cast this spell, you use the rope to create a circle with a
5-foot radius on the ground or the floor. (XGtE pg 165)
Whereas the description of Erupting Earth indicates the following (emphasis mine):
Choose a point you can see on the ground within range. (XGtE pg
155)
This seems to strongly imply that there is now a difference between "ground" and a "floor".
Presumably for the purposes of the Snare spell, the examples listed in the question (indoor room on an upper level, outdoor deck or patio, raised platform, roof, balcony, deck of a ship) would make sense to qualify as "floor" and there would be no issues with casting that spell in those locations.
However, for the purposes of Erupting Earth, a raised platform or roof etc. appears to be problematic at best (consider the wording of the Bones of the Earth spell, and what would happen to the roof of a building if six pillars of stone each 5 feet in diameter and 30 feet high were to appear bursting from that level) while the deck of a ship far off in the ocean makes it even moreso.
Ultimately, it is a magical world and up to the DM to apply their decision-making as consistently as possible, but it certainly appears there is an argument that - in the case of Erupting Earth - more than a "floor" could be required.