I haven't looked into Doom's code very much, but based on playing the game it seems that hit detection is done in 2d. If you are shooting a target above you there is no visual indication that you are aiming higher. You can shoot at a wall and still hit an enemy above you who you cannot currently see.
You may be right, I can't recall whether the hit detection cares about height, but Doom does at least some slope calculation to display the bullet-hits-wall animation at the correct height. If you look at rockets and plasma, these projectiles will also move in a slope. So if you're rocketing someone high on a ledge, it won't show you a rocket hitting the wall at eye level... even though such a rocket (if you fired it while not lined up with the target) could possibly damage the target. That may have changed with some later versions. At least some source ports change it.
In any case, heretic and hexen actually let you look up and down. Crispy Doom (among others) have backported this feature and hook it with mouse aim.
Try shotgunning someone high up and far far away. Either there's a distance limit to auto aim, or it's just really damn picky about how perfectly you're lined up. Most of your shots will hit the wall below him.. it can be frustrating.
I think it's just that there are less pixels to hit when the target is further away. I'm not sure if the height difference is taken into account when calculating damage on hitscan weapons, below a certain damage output (damage output is in part random) it might not register a hit.