In terms of total volume of games, technically it was the PS2, but a large portion of those games were the large volume of titles put out by 989 Sports and London Studio (the latter of which made a ton of EyeToy games). Relative to the size of the total library, then definitely the GameCube, since the PS2 had an insane number of games on it, perhaps more than any other console (if we exclude small digital-only games on more recent systems).
But when it comes to games large numbers of people actually played, the GameCube probably had somewhat better first-party support. Which makes sense, considering Nintendo is far more reliant on their first-party output than PlayStation is on Sony's output. In fact, the differences in the first-party situation were even more stark back in Gen 6. While the list of best-selling GameCube games is dominated by Nintendo games, that same list on the PS2 is primarily third-party games.
Aside from Gran Turismo, there weren't much in the way of big marquee first-party titles on PS2. Aside from GT, there was also God of War, Jak & Daxter, Ratchet & Clank, and SOCOM. While GT3 sold 14.89M copies and GT4 sold 11.45M, the next bestselling games were God of War at 4.62M, God of War II at 4.23M, and Jak & Daxter: The Precursor Legacy at 4.2M. Everything else outside the Top 5 first-party PS2 games (not counting the game that was bundled with the Eye Play accessory) sold under 4M copies, with most at under 3M. All told, there were about 20 first-party games on the PS2 that sold at least a million copies. This is on a system with a final install base of 160M. The original Gran Turismo was the only first-party PS game with a final attach rate of over 10% until GT5 and Uncharted 3 joined the club. So, while It wasn't until the PS3 and especially the PS4 that Sony saw their first-party output outside of Gran Turismo really start to explode in terms of popularity.
The GameCube, meanwhile, had 27 games that sold at least a million copies, all of which were first-party, and of which eleven were multi-million selling titles. This is despite having a final install base of only 21.74M units, less than one-seventh that of the PS2. It had nine games with an attach rate exceeding 10%, and of those four of them had an attach rate of over 20%. Melee sold 7.41M copies, giving it an attach rate of over 34% and making it the fourth best-selling first-party title of that generation behind only GT3, GT4, and Halo 2. Every since the N64, first-party games have been the main event on Nintendo systems, and to this day they routinely have first-party games with sales volumes and attach rates that few non-Nintendo games have ever achieved on any platform. I've often said that people get Nintendo systems mainly to play Nintendo games, and the numbers back that up.
TL;DR: It depends on what metrics you want to use.