But isn't Google Maps free?
The use of Google Maps (as well as many other map suppliers) is indeed free, but not free at the same time. Google has conditions on the usage of its maps. Generally vendor's have to pay to be able to access the API and use the maps that can be found on their websites. Even printing and distributing said maps is not allowed in many cases.
In addition, while Google Maps are available, the underlying spatial data is not. One can only use the maps as they are offered by Google. If you want to display the map in a different style or try your own routing algorithm, you simply can't. OpenStreetMap offers the "raw" spatial data so that everyone may use it as they wish.