You are talking about love hotels. They are extremely common in Japan and they are really not a big deal. Almost all of them are perfectly clean and they are cheap as well (for Japanese standards); for less than the equivalent of $40 you can get a room.
People who are dating use them a lot. Because flats are usually quite small, it is sometimes more convenient to spend the night in a love hotel than going home. Married couples use love hotels from time to time in order to be able to make sex without having to worry about the noise, or about a kid interrupting.
The most important for Japanese society is convenience! ;)