That's a very black and white way of looking at things. I certainly couldn't say that definitively, I suppose, as Mario Galaxy is extremely high quality. Galaxy at its best is truly amazing, but there are a number of low points as well. The hub is awful to navigate, a number of stages feel a bit sub-par compared to the rest of the game, and the music isn't always at 100% like I had hoped (the good stuff is out of this world, but the standard midi tunes are a bit dull).
The highs of Galaxy are better than anything in Sonic Generations, but I've simply had a more consistently good time with it. Still, it's a close fight between the two for me. I could easily flip-flop between the two.
Galaxy 2, however, was a bit of a disappointment. It did some things better, but other things faltered.
I am not a fan of exploration based platformers any longer, however. I find them all to be rather dull and pointless. The original Mario 64 is about the only one I can still enjoy.