So why do they have the slime and cocoons instead of beds?

They have cocoons because trolls are kind of an insect-based species.  And they have the slime to prevent them from having super terrible nightmares.