There have been numerous posts on countless grammar blogs that deal with the etymology, i.e., the origin of the expression “sleep tight.” While this blog values such information, it prefers to get straight to the point.
“Sleep tight" rhymes much better with "Good night" and "Don’t let the bed bugs bite," two other expressions that are often associated with "Sleep tight," than "sleep tightly" does.
But besides that point, the pragmatic reason why “sleep tight” works grammatically is because of this:
As you can see, “tight" can be both an adjective (as in a “tight shirt”) and an adverb.
Although we close bottles tightly, we sleep tight (not tightly).
Also, “tight" is used as an adverb in the common expression "sit tight,” which means “wait patiently” or “don’t change your mind.”