According to folklore, in earlier days people used mattresses that were supported by ropes (even at present in some places) and the ropes had to be tightened in order to make it stable and have a good night’s rest. This practice gave rise to the English phrase ‘sleep tight’. However, according to the Oxford English Dictionary, the meaning of ‘tight’ during 19th century meant ‘soundly/properly’, so sleep tight referred to ‘sleep well’. Take your pick, folklore or OED?