Could be that when you arrived, the room type you booked was full, but an upgraded room type had space available.
The same goes with rental car companies sometimes giving you a larger car than you booked (although that is not always an advantage, as when fuel was $5 per gallon, drivers renting economy cars expecting to drive a lot were refusing "upgrades" to large cars, vans, or SUVs).