Done it many times, mainly during business trips. Depending where you are, for just 5 hours there are better options than a hotel.
For example, in Seoul I would recommend a certain jjimjilbang just by the central train station where you can bath, take a sauna, massage... for much less than a hotel room, then zip to the airport by train in a breeze. Ditto for pretty much anywhere in Japan -- just relax in any onsen or public bath strategically located.
On the other hand, in Singapore's Changgi airport the hotel inside the international transit area is a great option and you're already in so you don't have to worry about anything.
It really depends where you are and what are the options available to you.
Money-wise, what does it matter?