Our bed is on top of the front storage compartment in our TT. The bed mattress' plywood base had a 1/2" gap between it and each side's built-in night stand top. This gap was exposed to the basement.
My wife was always afraid "something" was going to crawl in from the storage compartment. I was more concerned about the cold drafts blowing in under the sheets. The storage doors are sealed as well as anyone could expect, but they are no match for cold wind gusts.
Anyway, I finally got around to sealing it with a strip of 3/8" plywood 4" wide and 40" long screwed to the underside of each top. Each piece extends inward 1 1/2" under the bed plywood base.
Then I got some vinyl seal used for mounting truck caps to the bed. It came in a roll 1 1/4" wide x 5/16" thick x 30' long. Good stuff, very sticky on just one side.