Anyone that doesn’t say Gelatinous Cube as their favorite ooze is lying. Is it an ooze? Who knows? At the same time, it counts as one. Most importantly, its fun.
(It doesn’t hurt that its iconic.)
The prospect of being chased around a dungeon by a gelatinous cube really is almost kind of the D&D experience. The idea that a huge perfectly geometrical thing can chase people around with some kind of autonomy is so absurd that its brilliant. This is one of those moments where you don’t ask for a rationale explanation. Its cool, just go with it. Let the fun be fun, and run with that.
The other part of this that’s fun, is that this is a less is more creature. Whole dungeons full of these things would be boring, but every once in a while it’s kind of fun. It’s almost more like an animated trap rather than a monster, but that’s part of the appeal, in my opinion.
It’s also not the kind of thing you’d want to run into as a weaker adventurer, but it is in its own way, something to look forward to. It’s a sign of progress in the game. Same with other monsters, like a Beholder.
In the end, its fun. People don’t ask, where do these things come from? Never. Usually its, how do we escape? Or, how do we kill it? Sometimes, creatures are just fun. A gelatinous cube is a perfect of example of how that is possible.