They're mainly there to be an obstacle/resource drain. I wanted the dungeons to be dangerous and thus be flooded with monsters, but I wanted to avoid random battles too. I was planning to have you instantly remove them if you were two levels higher, but I ran out of time to implement that mechanic. Outside of that, they can kind of serve as a metric to measure your own power against!
I'll see if I can't make the fights a bit more rewarding going forward though.