I had the same problem on my 2008 Z-7 port and starboard rod lockers when I bought it used in 2018. I went to a BPS dealer and looked at newer models and talked to two mechanics. I did two things based on their recommendations. I did them both at the same time, so I do not know which one corrected the problem, but I suspect it was the second one. See below:
1. Actual rain water could be coming in from the hole where the front pedestal gets inserted into the deck. I have never had the pedestal installed, so I put a Bob's Machine Shop pedestal plug in both holes in the deck, fore and aft.
2. I believe the real problem, however, was actually condensation in the rod lockers. The air that gets in the rod lockers ends up getting sealed tightly. The moisture in the air condenses on the inside of the rod locker and soaks all rods and reels and carpet, including the underside of the lid.
2.1. 2018 and newer model Z-18s, -19s, -20s, and -21s all have 1 inch vent holes drilled in the bottom corner of the rear vertical panel of both port and starboard rod lockers. The holes are drilled from inside the rod locker, facing aft, about 1.5 inches above the bottom deck of the rod lockers on the centerline side of the rod lockers. There is an air gap between the rod locker panels and the fiberglass that you see in front of you when you are sitting in the passenger seat or driver seat.
2.2. I wish I had a photo of those vent holes, but I did not take one. You can go to a dealer and look at the new boats and see them for yourself. They are a little hard to notice, as there is no "ring" around the hole, just a hole in the carpeted panel. The BPS mechanic pointed them out to me.
2.3. These vent holes allow the air to escape the rod lockers into the open space between the carpeted deck of the boat and exterior hull that sits in the water.
2.4. I drilled one inch holes in the same places on my Z-7, being very careful not to penetrate any more than the rod locker panels. I did not want a hole in the fiberglass!
2.5. I have had ZERO water in my rod lockers since that day.
2.6. I believe the aft lids for the bilge and battery wells are also very tight and allow air to condense there as well, as there was evidence of mildew there, too. I now make it a habit to leave those lids cracked open during and after plugging in my charger to allow air to escape when it is in the garage. I simply leave the charger cord hanging out the back of the lid until I am ready to head to the water. This leaves about a 3/8 inch gap along the back of the lid to let the humid air escape.
No more water in my rod lockers and no more mildew in my battery wells.
Hope this helps!