Actual practice varies widely by country, but there are (at least) four reasons why hotels frown on having more guests in a room than you originally told them.
- Fire code. Hotels and rooms are rated for maximum occupancy: if they get busted for having two people in a room for one, or (worse) 101 guests in a hotel rated for 100, there are serious legal penalties (for the hotel) in many countries.
- Profit. A room for two usually costs more than a room for one, even when it's actually the same physical room. If you sneak two people into your single room, they've lost out on extra income, and obviously the beancounters don't like this.
- Registration requirements. Many countries require that all foreign nationals staying in hotels have to be registered, and it may be a violation of the law to have unregistered guests. (Not necessarily applicable if your newfound friend is a local, although a few particularly paranoid countries register all hotel guests.)
- Laws prohibiting cohabitation. Not much of a problem in the West anymore, but in eg. much of the Middle East, having two unrelated and unsupervised people of the opposite sex in the same room may be a crime (khalwat, "proximity"), even if you're not getting down and dirty.
The correct thing to do etiquettewise, then, is to book a room for two in advance, but unless you're sure you're getting lucky, this is often impractical.
The practical (but somewhat embarrassing) thing to do is to request an upgrade at the counter, at which point they can also register your guest. In places like Thailand, where rent-a-dates and sex tourism is big business, hotels either impose "guest fees" for overnight visitors, or (at the lower end) explicitly market themselves a "guest-friendly"; as far as I know, in Bangkok there's precisely one hotel which proclaims itself a "bastion of wholesome tourism" and bans overnight guests, and has achieved minor notoriety as a result!
But if you're stuck in some Atlanta-like institution, eg. Japanese business hotels where "single" really means "single" and you'd have to get another room, you could just do like us international uni students in the dorms did, and sneak your dates in via the fire escape, undetected by the beady eyes of the night security guard at the main entrance, and hope the good vibes balance out the bad karma.
Or, if you're not as skift as as exchange student and are actually in Japan (or most anywhere in Asia, really), you could go rent a love hotel and get a circular bed, mirrors on the ceiling, and bondage Hello Kitty watching over you.