Filled with the code of Doom
Absolutely it was considered scary. It's not very scary any more, because we've all played it a hundred times over. But back when it was first released, certainly.
You have to think back to the historical time period in which Doom was released and the kind of technology that people had seen in games until then. Wolfenstein 3D is a good comparison, as Doom's closest predecessor. There are obvious differences, like the fact that Doom has lighting effects whereas Wolf3D is at a constant light level. But more importantly, think about the general style and feel of those two games.
Id's games up until Doom all had a cartoony feel to them, dictated in no small part by the EGA palette and the fact that they had to use a lot of bright primary colors. That includes Wolfenstein 3D, with its treasure collecting, Hitler in a robot suit and "Let's see that again!" death-cam sequence. Doom broke completely from that style, using realistic textures and graphics, including the weapon sprites derived from photographs.
It's interesting to look at the press release beta as an example: originally Doom was going to have an arcade-style score and a treasure collecting aspect like Wolf3D. These were dropped before release by Id along with the original BFG 2704 which fired balls that Romero described as looking "like Christmas". Doom started off as a game like Wolf3D, but Id dropped these elements because they realised it had evolved into a different type of game: darker and scarier.
it's brighter and the music is generally lighthearted.
I disagree with both of these, and again, you need to look at the historical context in which Doom was released.
In terms of brightness, Doom 64 might be darker, but the point is that when Doom was released, most people had never seen an FPS game with lighting. Think about what it's like if the only games you've ever played is side scrolling platformers and maybe a bit of Wolfenstein 3D. Then you go to your friend's house and try this cool new game which makes Wolf3D look like a toy. When you get to the end of the first level you see this:
Don't tell me that's not scary.
As for music, I make no secret of the fact that I'm a big fan of Bobby Prince's work. But I reject your suggestion that Doom's music is lighthearted. People seem to have this belief that the Doom soundtrack is all just heavy metal and loud guitars all the way through, and that just isn't the case. You can read the comments from Bobby Prince himself:
The id Software development team originally wanted me to do nothing but metal songs for DOOM. I did not think that this type of music would be appropriate throughout the game, but I roughed out several original songs and also created MIDI sequences of some cover material. This was before any level design and was before most of the artwork had been created. As the game came together, the guys at id saw that this type of music was not appropriate for many of the levels in DOOM. Thinking that this would be the case, I had also roughed out a lot of ambient moody background music, much of which ended up in the game.
The E1 soundtrack in particular has a number of really good moody atmospheric songs: check out E1M2 and E1M5 which are positively haunting. Music contributes a lot to the atmosphere of the game, and I find that Bobby Prince's work does a much better job of creating a scary atmosphere than the Doom 64 soundtrack, which just sends me to sleep.