Granted your hardcore character reached at least level 10, they don't. They can be moved to a seperate tab where all the fallen heroes are listed.
For a hero that hasn't reached level 10 you can either keep him in your character list (and thus takes up a spot) or just delete him to free the spot for another attempt at hardcore, or a hero for softcore.
Reworded, as you have to move the character yourself and stays in your active character tab until you do so. Credits to SirCobalt.