This is an interesting question, and I would say this has to do with occupancy rate (how many rooms are used, or how many cars are out). And more precisely, what matters is the rate of paid rooms/cars, rather than the rate of occupied rooms/cars.
On top of this occupancy rate, pricing is also a complex business. Maximizing the revenue is a task all airlines, hotel chains and car rental companies work hard on. Rental car pricing is particularly complex, so this may be beyond common understanding.
Let's take 3 industries: hotels, rental cars and planes.
The airline industry is the reference in terms of maximizing the occupancy rate. The occupancy rate is one of the top measurement for the performance of an airline. A high plane occupancy rate for airlines means higher revenues, but especially no loss due to an empty seat.
In this industry, a seat has costs whether it is occupied or not, in particular in terms of fuel, but also because flying a plane has fixed costs, like airport fees (landing, boarding, ...). So in this industry, it sometimes matters more to sell a seat whatever its price than keeping it empty.
And in terms of cancelling, airlines would lose offering free cancellation at last minute. The details of the cancellation price is mostly a matter of right pricing, but you get the idea : passengers cancelling a flight implies the airline has to find a new customer, so cancellation should be prevented.
The second industry, hotels, also uses occupancy rate as a main measurement of its performance. In this case, the cost of a room has mostly two factors: the maintenance (i.e. the cleaning and repairs) and the real estate value. An empty room does not have as high costs as an empty plane seat, but for a city hotel, due to the real estate cost, a hotel would still tend to maximise its occupancy rate.
Hotels also depend a lot on the activity of the city around, and so have high- and low-seasons. It makes sense for them to try to sell all rooms in high-season, while in low-season there will always be empty rooms.
This would explain why cancellation is not always free. Note that first, hotels usually offer free cancellation until 1, 2 or 7 days before the booked night, or have cancellation fees lower than the price of the room. If in high-season, a cancelled booking in a full hotel means another customer might have booked it, so this is a loss of revenue. In low-season, there are enough rooms for all potential customers.
For rental cars, I see three main costs: the maintenance, loss of value for the car, and the parking costs. The maintenance depends mostly on the mileage. The loss of value depends on the age of the car, but mostly on its mileage. Rental car companies try to optimize when they sell their used cars, and the mileage per year of a used rental car is higher than the rest of the market. Then there are parking fees, and usually rental car agencies try to work where real estate costs less (like near airports). So overall, costs for rental car agencies is mostly dependent on the mileage, i.e. on the usage of the car. In other words, if the car is not rented, costs are low.
For this reason, what matters to rental companies is not to maximise the occupancy rate of a car, but to maximise the revenue per mile, or per day. Their pricing is relatively obscure (they often offer unlimited miles), but what matters to them is that you give them much money when you drive their cars, not that you keep it for long. And in some cases, notably if you pay in advance or go through a broker, you might still get a non-cancellable booking. Note that to lower the parking costs, some introduced a fee if you return your car more than 24 hours in advance. So in the end, if you cancel at the last minute, the cost of losing a customer is low.
And as a personal experience, I was surprised when I called the rental company to tell them I would return a car late by a couple weeks. They didn't seem worried, they did not even check if they had a booking on that car. So I suppose their occupancy rate is particularly low, they might not be used to have all their cars out (and given the size of some airport rental car agencies, I am sure they always have one if you show up unexpected).
The bottom line
In the end, pricing is a complex concept, so there might be a lot of reasons for pricing cancellation. But my guess is that occupancy rate is the most important factor in that case. Rental cars have low cost if they are not rented, therefore offering free cancellation does not incur high costs to the agency, unlike for airlines or hotels.