Sleep tight is used for telling someone, especially a child, that you hope they sleep well.
It seems this phrase goes back to the days when mattresses were supported by ropes which needed to be pulled tight to provide a well-sprung bed.
Old mattresses contained a variety of natural materials including straw, wool, feathers or horse hair. The innerspring mattresses were only invented in the late 19th century.
Sleep tight is common at bedtime in the form of the rhyme "good night, sleep tight, don't let the bedbugs bite".