Hum cards are still used in the 3DS (with 2GB game cards being a common case). It is clearly a matter of usage optical is also a pipe dream that is why UMD failed. HDD disk are pipedream for tablets and phones... Download only is a pipe dream for a lot of people with sucky connection...Flash is a pipe dream, cheap eMMC perf is far below even 5400rpm hdds (relevant because optical is now just a transport media to install bits to your HDD). However cheap flash gets stamping optical disks will be cheaper still. Besides which raw NAND chips are good for nothing, you have to mount them to a PCB, mount that in a plastic box and flash them. All of these steps take time and add cost relative to the alternative of stamping out plastic discs. Consumers have already voted and said 'crappy first time play wait times are fine' back in the PS1 vs N64 days so the only advantage of flash is basically moot. We'll get to download only before we see a return to carts
The online infrastructure for digital download ain't free, HDD definitely not free, neither are optical drives. Optical are ~free not the surrounding overhead... Now I think nobody expect PC or MSFT or Sony consoles games to be shipped on SD Card.
Game card have a cost that does not mean that there is no business case that could make use of them.
EDIT
Taking the concrete case of the 3DS there are games that are tiny enough so they should be download only, that is how you would achieve the biggest margins... assuming you manage to sell the game.