The practice probably harks back to the days of ferry crossings where people paid a fee to be ferried across stretches of water. As boats became impractical to carry large loads, ferry operators looked for new sources of revenue. Having built a bridge, they hoped to recoup their investment by charging tolls for people, animals, vehicles and goods to cross it.
Many of London's bridges across the River Thames started out as toll bridges but were taken over by the Metropolitan Board of Works during the 19th century. However, the practice of building bridges for private (or local authority) gain continues.
Modern examples of toll bridges