The Wii U's library is actually pretty good, if somewhat on the small side.
Pikmin 3, Super Mario 3d World, the Zelda HD remakes, Super Mario Maker, Mario Kart 8, Splatoon, Bayonetta 2, Xenoblade X, DKCTF, Smash 4, Hyrule Warriors, Yoshi's Wooly World, Rayman Legends, and much more. Many of these are genre defining and among the best games of their respective years. In 2014 the general consensus was that the Wii U actually had the best lineup of the HD systems since the PS4 and XB1 had such a disappointing year software-wise.
It took a while to get there though. The game drought of early 2013 really hurt the system right after launch and killed any momentum it might have had. Had Nintendo had games ready for release in those first 6 months of 2013 instead of relying on just Lego City and a remake of the Wii's Monster Hunter they could have done much better, but HD development was still very new for them.
The terrible marketing was an even bigger problem for Nintendo than the lack of games in 2013. They focused so much on the gamepad that the general public was confused as to whether it was a console or just a peripheral, and the gamepad lacked the immediate appeal and ease of understanding the Wiimote has.
The hardware was a problem in the sense that it was difficult for third parties to develop for and overpriced for what it was. The GPU was the best part and much better than what the 360 and PS3 had, and the system had about double the usable RAM. But the RAM was slow and the CPU was pathetic, both really bottlenecking the system. If the system had sold better third parties would have had more reason to put the effort into working around those bottlenecks, but with its poor sales there was no incentive to put in the extra work for games that wouldn't sell. The Wii U's specs also did not justify a $300-$350 price tag even though Nintendo was actually selling it at a loss. It seems that the gamepad and all its bells and whistles were what pushed the price so high, and that price never went down. A Wii 2 with the same specs and a focus on the Wiimote again would have been much cheaper and sold much better, Also, a system with better specs but no gamepad would have been easier to develop for, more worth the price, and also sold much better. In both cases the lack of the gamepad would have automatically improved the marketing by forcing Nintendo to focus on the console.
The gamepad itself is what doomed the system. Without it there would have been no confusion, the system could have been either cheaper or more powerful, the marketing would have been better by default, and it would have been able to capitalize on more of the Wii's market. The early 2013 drought may still have happened, but there likely would have been more third party games in that period under such a scenario like Rayman Legends, which was delayed to be released on other platforms when the Wii U started to fail.