I came across this one on a ghost hunting programme (!) I saw recently involving a very old, supposedly haunted bed.
The bed itself was a very old, crudely made one. Instead of a solid base or wooden slats beneath the mattress, it had ropes or thick strings across.
These could obviously start to sag over time and needed to be tightened. According to the presenter, this is the origin of the phrase: Sleep tight!