However, ropes stretch and loosen with use. A sagging mattress made for an uncomfortable, lumpy night’s sleep. The nightly ritual, therefore, included using a wooden tool called a “bed key” to tighten the ropes. The tighter the ropes, the firmer and more supportive the sleeping surface. So, to wish someone a good night’s sleep was literally to wish for their ropes to hold fast: “Sleep tight.”
The phrase "Sleep Tight" has inspired numerous articles spanning historical linguistics, modern technology, and medical research. The Curious History of the Phrase Sleep Tight