Nintendo notes this is just for the DS and Wii and won't affect Wii U and 3DS games, although Wii Mode won't offer online play on Wii U and similarly DS games when played on the 3DS.
The two systems aren't losing all online functionality. The DSi shop and Wii U Shop Channel are staying open, and users will still be able to access the DS Browser and Wii channels like Neflix, Hulu, and YouTube. The company also published a full list of the affected games.
Nintendo didn't provide an explanation for the discontinued service in its announcement - nor did it ask the last ones out on DS and Wii to remember to turn out the lights - but it did thank its fans for their continued support and enthusiasm for its "legacy systems."