Could our opinions maybe be influenced by whichever game we play first of the two? Because I bought a Wii bundle that included Mario Galaxy 2 and only played the first one a while later - and 2 is definitely my favourite out of the two.
It's entirely possible, I'd imagine. The two games are incredibly similar, as they're both built and designed around the core concept of gravity and how to best utilize it in numerous ways. Galaxy 2 was a bit more linear in its design with the classic overworld map, and I'm sure that many would argue that its level design and added features such as Yoshi make it a superior game to the original. But like all pieces of entertainment that are considered "revolutionary" or "best in class", the original will always be the one that "wowed" people first, regardless of whether or not its sequel was a bit more technically superior.
I do feel like the original had something a bit more special to it, though. The Comet Observatory was much more fleshed out than the Starship Mario, and I think the original just had more personality overall. Captain Toad, Luigi, and Rosalina had far more pronounced involvements than in the sequel, and the touching side-story for Rosalina was a nice deviation from what we normally expect from a Mario game. It's probably for those reasons on top of the "wow" factor that I consider the original superior, although it's very much like other popular series such as the Rare
Donkey Kong Country series or the SNES
Final Fantasy games in the way that the quality is just so high throughout, it's hard to truly name one that's "better" than the rest.