An accepted answer on my source is that they make no money from it. If they did, Nintendo would likely be more inclined to shut it down, as they likely don't want people profiting off their games too much.
Another answer is that it may bring focus onto the main games. If you play Showdown and enjoy it, you're likely to pick up a Pokemon game as well. So Showdown might help with sales a bit.
Hope I helped!
Source