It's wrong but I've seen shuttle bus drivers knowingly agree to do this for a somewhat big tip.
In fact, once I was on an airport-to-hotel shuttle which was late and packed, and then the shuttle stopped at a different hotel first and most of the passengers got off. I reported this to the hotel GM the next day who confirmed that, as I suspected, this was not a "cooperative" shuttle arrangement and in fact, the driver's actions were unknown to the hotel and clearly against the rules, especially as the other hotel wasn't even located on the route between the airport and the hotel that was providing the shuttle and (at least formerly) employing the driver. In my case, I came very close to getting off the shuttle at the wrong hotel, which would have required a long and cold wait in a sketchy neighborhood late at night.