When his wife was pregnant with Rapunzel, she craved for greens from the garden of the Witch who lived next door. He got caught by the Witch. When he explained he needed the greens for his pregnant wife the Witch let him go in exchange for letting him go with the greens, she would get the child. When Rapunzel was born, The Witch took the child but also placed another curse that made him and his son infertile.
In the original stage production he had a larger role, and even a song (part of it can be heard in the background when he urges The Baker not to abandon his son.