I don’t like it when people act as if these were objectively bad jokes. Many jokes are very dependent on a specific cultural moment as well as carefully crafted wording. Lots of current jokes fall can flat if you slightly change the phrasing, even if they aren’t word play. And then there’s delivery, pacing, knowing your audience…
Surely widespread literacy and technology allow modern people to develop comparably sophisticated tastes just by the sheer wealth of entertainment we consume, but people 5000 years ago were still people and I’m sure they found humour in similar places as we do.
edit: here’s a source: https://www.reuters.com/article/us-joke-odd-idUSKUA147851200... Again, I would take issue with the reduction to “toilet humour”. Clearly the comedy of manners aspect plays the larger role, even if farts are somehow eternally funny.