They haven't been popular since the time that the Card-E Reader came out, back when kids started realizing how gimmicky it was becoming and gave it up for more up-and-coming TCGs, generally there is less shame in being a Yu-Gi-Oh fan in high school than there is being a Pokemon fan, for some reason the former never developed an ignorant stigma. Kids took the path of least resistance, which was wild because you don't want to be the last person you know playing a TCG, then the game element goes out of it and you have more cardstock than you know what to do with.
The thing is, they're still produced because Nintendo is profiting off the fact that so many stores are behind the times. Managers of small businesses and even presidents of companies tend to be the people who still call it "pokeyman" and such, and are the ones who have no knowledge of (or outdated knowledge of) the current state of the TCG's popularity and assume that children are still cleaning the shelves of the cards, and because of this, even if Nintendo knows the game is completely dead, they can still turn a handsome profit because no retailers realize it.