All you could ever want to know about a one-night stand is on the wikipedia page about it:
A one-night stand is a single sexual encounter without an expectation of further relations between sexual participants. This is regardless of whether a single encounter was originally intended by either participant to be a one-night stand, or whether further relations between the participants subsequently arises. Critics of the practice describe it as "sexual activity without emotional commitment or future involvement".
As to the background, I'm conjecturing that one-night means one night and stand is used in the sense of:
n. - 3. A stop on a performance tour.
This is in relation to a musical performance and there is evidence that "one-night stand" actually also refers to a one night only musical performance.
a. A sexual encounter that is limited to only one occasion.
b. A person that one has such an encounter with.
A performance by a traveling musical or dramatic performer or group in one place on one night only.
So, a single night performance of a sexual act.
As to removing the hyphen... it can be done. But context is important, otherwise someone may think you're talking about a singular one of these (though the space is generally removed: nightstand):
One Night Stand