Oh god, this is so hard for me, because there's so many wonderful games to give love to in this genre for all their own reasons, with their own high points and low points that I love all the same. Even just purely speaking about 2D platformers this is the case. There's just so much to love and I absolutely can't narrow it down to just one thing.
Like, for instance, Yoshi's Island has an absolutely gorgeous art style, fantastic level design and music, unique bosses and midboss concepts in each world that don't really get reused, etc. However, it's one weakness is that it kindaaaa sucks to 100%, since you have to get all the Red Coins/Flowers/Stars in each level in one go. This is particularly annoying in levels like the skiing level. This wouldn't be too big of a deal if the collectibles were just nice bonuses, but bonus levels are hidden behind collecting them all. So it's a minor thing, but when we're talking the top tier of games, that's the kind of thing I'm talking about when it comes to strengths and weaknesses even with my absolute favorite 2D platformers (which Yoshi's Island is absolutely one of).
Or Donkey Kong: Tropical Freeze for instance. In its case, fantastic level design (including smart placements of the Snowmads/smart differentiation between the different types of Snowmads and how you're supposed to deal with each and why, as in, it being very clear which ones you can dispatch however you want, which you have to attack from the sides or above, which you have to use particular attacks on, etc), AMAZING music, very fun to control DK & crew, pretty good variety of level settings/art design of the levels, etc. But in its case, for me, the bosses are its weak point. Like Yoshi's Island, they are all pretty unique from each other. But I wasn't the biggest fan of the bosses following a formula of like 3 phases that each require 3 hits each or whatever as I personally felt that made them drag on a bit and I was mostly there for the platforming stages and wasn't that invested in the bosses to begin with. So again, it's a small thing, but that's the type of thing I'm talking about when it comes to the top of the top and it being so hard to narrow down an absolute favorite, especially since the strengths/weaknesses are in different categories (in Yoshi's Island, the weakness being 100% related, whereas in DKC:TF its about the bosses--totally different pros/cons, making it hard to rank).
Then there's something like New Super Luigi U/New Super Mario Bros. U Deluxe (Switch). Absolutely fantastic level design, Nintendo absolutely knows their stuff when it comes to 2D platformers. Challenge Mode was also a wonderful idea, giving the game even more content in a wonderful way. As someone who sucks terribly at platformers, I also loved the addition of the character of Nabbit as basically a "cheat" system/easy mode that still felt fun to play, unlike previous implementations like the Super Guide where you were basically just watching as an AI Luigi went painfully slowly through the level. Having the option to play the game on god mode and only have to worry about pits/lava/getting crushed was great (and it certainly doesn't hurt that Nabbit is cute). But on the other hand, the game does use the same basic settings for the worlds that Nintendo has been using since SMB3 and SMW and though it was touched up for the Wii U, it's still nonetheless using the basic archetypes of the NSMB artstyle and music. I don't care about those type of things as much as most people, as in, the artstyle and music don't actively bother me and I don't have active problems with them at all and think the game itself looks fine. But nonetheless, when comparing it to something like say Tropical Freeze which feels much more creative with its aesthetics, it's the kind of thing that comes to mind that makes it hard for me to pick (especially when the "flaws" of each game are different, art-style vs. how the game handles bosses).
Celeste is also incredibly high up there. Some absolutely fantastic levels and platforming, great music, and I love the themes of the game's story. I also absolutely LOVE the assist mode of the game and how much control that gives you to play the game the way you like. Again, being someone who sucks and who sometimes just wants to play these games for the exploration and just try and find collectibles and stuff at times when I'm in that kinda mood, that kind of stuff very, very strongly appeals to me and I greatly appreciate and gives it strong points in its favor. On the other hand, compared to games like Tropical Freeze or Yoshi's Island or even NSMB, Celeste doesn't have that much diversity in the settings and aesthetics of its levels. That of course makes sense because it's a game about a girl climbing a mountain, that is, the game is largely centered in one location, but when it comes to the best of the best and which one is my absolute favorite... you get the drill by now. It's just hard to say which set of pros and cons I truly put above any of the others like that.
And I could do absolutely the same thing with other games I absolutely consider to be among my favorite platformers, such as VVVVVV, Rayman Origin, Kirby's Epic Yarn, etc. I love them all, and think they're all absolutely fantastic and that's why my favorites, but when it comes to just picking my one absolute favorite platformer, it's just incredibly hard for me because I so easily recognize their respective strengths and weaknesses but saying which set matters the most/least to me and picking a definitive favorite for 2D platformers... I just can't do that. I hope that makes sense.
Strangely though, for 3D platformers, that's much easier for me: Super Mario 3D World. I just love the feel of actual platforming in it (which is a problem in many of the earlier beloved 3D platformers, such as say Super Mario 64, which barely require much in the way of actual platforming/more than just the basic jump here and there until say Tick Tock Clock and Rainbow Ride. Of course, 64 is still a great game, but not really what I'm looking for in a 3D platformer exactly). Absolutely fantastic music like World-Bowser and Hisstocrat, and just the aesthetics of World-Bowser itself while I'm at it. It also has a very fair and generous completion requirement (in it's case, the amount of Green Stars you need to collect) that doesn't feel overbearing at all (I bring this up because other beloved 3D platformers, like in this case Banjo-Kazooie are a bit high with the number of Jiggies/Notes you need to get access to the final Grunty fight. Great game all the same, but I'm not a fan myself of needing to get like 90% of everything in a collectathon platformer to get to the final boss). And of course the optional Green Stars/Stamps giving you plenty of reason to explore the levels inside and out, especially since some are hidden in really clever ways (like, I remember really liking what they did with Hands on Hall's collectables).
And just how pure FUN the levels were to play. Like, Red Hot Run for instance. It's definitely a bit tricky at fist, or at least it was for me (like I said, I suck; I make no secret of that fact. xD). But then I kept it, and when I got it, I GOT IT. And it was just an absolute blast to just be able to blast through that level as Toad at full speed (not that you have much of a choice but going full speed in that level), and that was something I was easily able to do again and again and again, and still have a blast with it, which is a feeling few other individual levels in 3D platformers have ever given me. Usually, no matter how much I enjoy a level, I'm good to move on once I finish it. But levels like that in 3D world were very easy for me to revisit.
The only 3D platformer that really comes close is probably Galaxy, which I have very similar thoughts about. Fantastic diversity of levels/worlds/settings. Absolutely fantastic music. And I greatly appreciate how you only need 60/120 Power Stars to beat the game, which gives you so many different routes you can take to beat the game, so many different combinations to try, which makes the game itself very replayable (which is one of my main critiques of Super Mario Sunshine: needing to beat the Shadow Mario mission in each of the main worlds, and the Shadow Mario Mission always being one of the last ones means you have to do all the same main Shines each time you play it so while you can change the order you play them in, you still have to get those Shines all the same). However, what makes me put 3D World above Galaxy 1 these days is something that many people actually see as a detriment of the game: the timer. Or rather, not the timer itself, since I don't like the timer itself and wouldn't mind if it wasn't there at all, but rather how comparatively "bite-sized" many of the levels of 3D World are. They're as long as they need to be, and no longer. That makes it very easy for me to either make the decision to just move on to a different level, or just replay them over and over and over again, like I went in to about Red Hot Run above. Those kind of bite-sized levels just personally suit my tastes more these days.
So yeah, while for 2D it's pretty hard and like Tropical Freeze/Yoshi's Island/NSMBU DX/Celeste/VVVVVV/etc are all definitely up there and fighting for that spot for their own reasons, for 3D I'd definitely have to go for Super Mario 3D World as it achieves the best balance of what I'm looking for in a 3D platformer while being a fantastic game.