The Wii U might have been a commercial flop, but that hasn't stopped it from becoming a collectible, even if it was unintentional. Nevertheless, of all the things likely to go wrong with the Wii U, a broken GamePad is pretty high up on the list, and once the GamePad stops working the Wii U is next to useless.
Some games will function without it, but that list is short, and given that there was never an option to purchase a replacement either from Nintendo or a 3rd party, only the second hand market remains.
Thankfully, if you have a Wii U with a broken GamePad, or even if yours works fine, and you want to keep it that way, there is now an open source alternative.
Vanilla is a work-in-progress software clone of the Wii U GamePad for a range of devices including the Raspberry Pi, Steam Deck and Android. It heavily depends on low level access to the Wi-Fi hardware, and there is an extensive list of supported and unsupported wireless devices. As it stands at the moment, the ROG Ally and Ally X (available on Amazon) are unsupported due to the MediaTek MT7922 wireless adapter in those devices, but hopefully it won't stay that way for long.
Similarly, there is a version for the Nintendo Switch, but this requires a Broadcom firmware patch or an external Wi-Fi adapter, which likely also requires a modified Switch. However, it will work on a range of Linux based laptops (Windows is also coming) as long as the Wi-Fi hardware is supported.
Given the closed source nature of Nintendo's hardware, reverse engineering the protocol is quite an achievement, both extending the life of the Wii U for those with broken GamePads and giving the wider community options to keep the Wii U in service (despite Nintendo's best efforts to kill it).