What happens when I transfer a Pokémon to the Professor?
Transfer the Pokémon to the Professor You receive Candy in exchange for transferring a Pokémon. Be careful—you can’t get the Pokémon back after you’ve transferred it to the Professor.
cited from the support page
You receive 1 candy per pokemon transferred, regardless of the pokemon's level of evolution or CP. (Hat tip to @CreativiTimothy) for sharing this in the comments.
Transfering to the Professor is a way of permanently removing a Pokemon from your inventory.
In exchange for a transfer, the Professor will give you some Candies, that can be used to power up and evolve a Pokemon. Note, however, that these Candies are limited to the "family" of Pokemon denoted.
Though implied in the answers so far, it might not be obvious that the purpose of this (in addition to candy) is because you have finite storage space for Pokemon; this allows you to free some up.