While this is true in many of the plots and themes explored on the show, especially the Dominion War, it by no means meant the show always took itself super seriously. In fact there is much more humor and general levity on DS9 than TNG which felt more stuffy and righteous.
It wasn't outright comedy besides a few episodes (Little Green Men, Our Man Bashir, Take Me Out to the Holosuite, Ferengi episodes), it was natural banter between character pairs (Odo and Quark, Bashir and Garak, Bashir and O'Brien, Worf/Martok/Sisko, Jake and Nog, the entire extended Ferengi family, etc.). Often episodes would be structured with a "serious" A-plot and a more soapy B-plot where most of the shenanigans would take place.
It's part of the reason DS9 felt, to me at least, more real and lived-in than TNG. TNG was promoting an ideology, a religion of sorts. Very aristocratic, many sacred cows. You would not expect humor to show up much for such people. DS9 on the other hand showed people living in a less than ideal situation, dealing with a galactic shitstorm that washed up on their shores. One of the ways real people deal with such situations is humor.
Granted this was the 90s, since 9/11 TV shows, including Star Trek, became more dark for the sake of being dark. Seemed like Archer was torturing people every other episode at times, and I'm not sure he knew how to smile. And for the epitome of "dark and super srs", look no further than nuBSG, where characters could not even take a dump without Irish bagpipe music being played over it.
Yes I miss the 90s. A lot of what I said about DS9 applies to Babylon 5 as well.