That's normal in tanks with moist substrate. The gnats' larvae feed on the fine layer of fungi and bacteria that inevitably grows in that situation. It's nothing to worry about; if they get to be too thick for your preference, just change the substrate.


