First of all, DOOM isn’t raycasted. Second of all it’s 3D in the sense that all objects have xyz coordinates and can move in that space. You can miss the monsters by having a rocket go over their heads. The main limitation is that the levels couldn’t have more than one ‘room’ per vertical space.
The rendering can still be implemented as polygons (making it true 3D rendering) whilst still maintaining the same level-based limitations, as we can see with DOOM 64.