Booking sites like expedia and booking.com sell a certain kind of inventory: "bulk" inventory or last-minute unbooked inventory. It's why you don't generally get loyalty points or other benefits when using these sites.
To put it another way: the hotels are the customer, not the guests. Expedia/booking.com are helping the hotels with inventory management. A guest is just the way these sites offset their costs.