‘The Room of Doom’ may just be the Marauders’ own name for it.
There’s no mention of any place in Hogwarts called ‘the Room of Doom’ anywhere but displayed on the Marauder’s Map in the movie “Harry Potter and the Prisoner of Azkaban, and on the official replica of the Map that’s sold as merchandise. What seems to be the most likely explanation for this, when considering the other labels used on the Map, is that it’s the Marauders’ own term, and the Room itself is not actually called the Room of Doom. Near to the Room of Doom is a room shown as ‘the Vestibule of Mischief’, which also seems an unlikely name for a room in Hogwarts.
Both ‘the Room of Doom’ and ‘the Vestibule of Mischief’ seem to be names that the Marauders themselves would invent rather than the actual names of those rooms. Other things depicted on the map are also labeled in a way that the Marauders would’ve found useful rather than by proper names. There’s a room labeled ‘Beware— Boggart in this closet’, a passageway labeled ‘Beware of moving staircases’, and both a room and a passageway labeled ‘Peeves may lurk here’, all of which are clearly meant to remind the Marauders of these hazards rather than being names.
Therefore, it seems most likely that the Room of Doom was only called that by the Marauders.
The purpose of the room, or why they’d label it that, isn’t known.
Exactly what room the ‘Room of Doom’ really is isn’t clear - its intended purpose isn’t known. However, presumably there was something about the room that made the Marauders consider it to contain ‘doom’ in some way, whether doom to them specifically, like a teacher that would want to stop their mischief, or more general danger. There’s certainly a reason for its name, but it’s not known what exactly that reason would be nor can it be logically deduced from the name itself.