Physics for Doofuses: Why Beds Exist
scottaaronson.com
scottaaronson.com
An alternative (and simpler) explanation for the purpose of beds that I read somewhere is that they play a role in night-time thermo-regulation. (I can't find the source now. It probably wasn't very scientific.) The idea was that humans evolved in warmer climates than most live now, so they require additional night-time insulation.