In the 1500s English houses had thatched roofs, thick straw piled high, with no wood underneath. It was the only place for animals to get warm, so all the cats and other small animals (mice, bugs) lived in the roof. When it rained it became slippery and sometimes the animals would slip and fall off the roof.
* Hence the saying "It's raining cats and dogs."
There was nothing to stop things from falling into the house. This posed a real problem in the bedroom, where bugs and other droppings could mess up your nice clean bed. Hence, a bed with big posts and a sheet hung over the top afforded some protection.
* That's how canopy beds came into existence.