Bunk mattresses get damp because the water vapour emitted by bodies condenses at some point as it passes through to the (normally cool) underside.
You can avoid this by sleeping on a plastic sheet, but that is yucky
When we made the mattresses for Milvina, we sandwiched a thin layer of closed cell foam between two 2" layers of fairly stiff porous foam
This has worked well even in Arctic Norway up to past 79 north.
Our aluminium hull has 2" foam insulation too, which helps, but is not enough on its own to avoid damp mattresses in cold water sailing
We have NO ventilation under bunks. All the mattresses lie on painted plywood