First thing i would do is always make sure canvas is tucked properly . This will help make sure bunk is closed properly. In some cases water pools in near the hinge and the water is wicked up from the bottom. I have minimized further damage by covering camper when i can, primarily over the winter. Although not waterproof, the cover sheds most of the water away from camper, minimizing potential damage.
2006 Roo 23B hybrid
1999 Chevy Silverado Ext cab 4.8L with tow package