A ton of reasons.
Reason Number One: Marketing. Marketing. Marketing. The Wii and Switch were underpowered, but they have been hits due to marketing. A lot of Wii U ads focused primarily on kids and their parents. Not a good idea. It's ok to show families, but don't make that the bulk of your advertising. The name itself is a marketing thing too. Wii U is a terrible name. And the marketing confusion early on cemented the sentiment that the Wii U was a tablet add-on for the Wii. Obviously, no.
Price. I kind of get why the console launched at $300 and $350. But once it was clear how much it was struggling, Nintendo should've given a massive permanent price cut. Sorry, a Deluxe model (even with a game) for $300 is still a lot of money for a console that is not as capable as the PS4 and Xbox One. Sony has been willing to take losses before to get more hardware out. The Wii U should've been cut to $250 by 2014 to 2015. By the end of its life, it should've been $200.
Wasting the Tablet. No Wii U game could support two tablets. The tablet also drove up the cost. I have to imagine the Tablet would be at least $100 if sold separately.
Missing or Disappointing 1st Party Games: Launching with New Super Mario Bros. U? A game that played it super safe? Disappointing. Giving us a sequel to 3D Land instead of a Super Mario 64-esque game? Disappointing. No main series Animal Crossing game? Disappointing. Rushed Mario Tennis? Disappointing. No exclusive Zelda? Disappointing. Mario Party 10? Ugh. Need I go on?
Very weak third-party support. The Wii U has what many would consider the worst third-party support of any Nintendo platform (excluding Virtual Boy, obviously). The lack of third-party support has to do with the marketing of the Wii U, and that it was hard to develop for. Even though the Wii U is overall more powerful in most ways than the Xbox 360 and PS3, the processing speed is slower. Nintendo shouldn't have compromised here.
I could say more, but I think I've said enough.
I agree. The controller was the reason Nintendo couldn't cut the system's price. They could have, but they would have taken a loss...and Nintendo is very wary of losing money on Hardware sold.