While the points being made in this thread are valid, I would argue that even if the Wii U concept had been better executed (featuring stronger first party games, robust third party support, a lower price, more powerful hardware, and a longer six year lifecycle) the console potential would have still been capped at maximum 40 million units
Wii U's main problem was Nintendo
Nintendo's reputation in the home console market at the time was kinda shaky. Many consumers viewed the brand as unreliable for delivering long term support for stationary consoles. This perception was a holdover from the Wii era, which, despite its commercial success, left traditional gaming audiences feeling alienated due to its casual focus and underpowered hardware. Worths nothing Wii followed the atrocious Game Cube and the very divisive Nintendo 64, at this point we had a whole generation of gamers who had never seen Nintendo systems as an option to a main console
Compounding this was just a lack of trust among gamers who wanted a dedicated home console experience
Imo, Nintendo took to long to embrace HD development. The general perception was Nintendo was a very poor HD gaming developer (and by some extent I agree with that feeling). This issue reinforced the broader notion that Nintendo excelled in handheld markets but lagged behind in the home console space, pushing people further away from Wii U
The 3DS, for example, often received the same franchises as the Wii U such as 2D Mario and Smash Bros at a far more affordable price point. This undercut the Wii U's value proposition, making it harder for consumers to justify purchasing the system. Remember: At this time Nintendo hardware was mostly seen as secondary console, PS4 was 400 USD and much more powerful, with better games and very goodwill from customers, if you are really dying to play Zelda or Mario Kart it's better to get a 3DS for 170 USD instead of a Wii U for 300 and the bonus is you get a console to play on the go