I stayed a couple of times, one time we were staying in a city that is about 3 hours from the airport, so the last night before our early AM flight, I booked the hotel near the airport. Otherwise, we would have had to leave our hotel at midnight to make it to our 6 or 7 am flight.
Another time, I had a connection, where I arrive 8 pm and my flight next day is 3 pm, in a city that has lots of traffic, so just got a hotel near the airport. It saved me 2-3 hours of taxi time, and $, it was cheaper than in the center, and the hotel provided free regular shuttles to / from airport.