Going by the RAW, there does not seem to be a rule stating that you need both hands free.
According to the PHB climbing rules:
While climbing or swimming, each foot of movement costs 1 extra foot (2 extra feet in difficult terrain), unless a creature has a climbing or swimming speed. At the GM’s option, climbing a slippery vertical surface or one with few handholds requires a successful Strength (Athletics) check. Similarly, gaining any distance in rough water might require a successful Strength (Athletics) check.
However, a DM may decide that holding a struggling creature makes a climb impossible or at least more difficult.
If I was DM, I would probably impose disadvantage on any climb checks made with only one hand available, and maybe give the grappled creature advantage on checks to escape the grapple while the grappler was occupied by a climb.
Keep in mind also that the grappling rules state:
Moving a Grappled Creature: When you move, you can drag or carry the Grappled creature with you, but your speed is halved, unless the creature is two or more sizes smaller than you.
If you have a standard movement speed of 30 feet, no climb speed, and are Medium sized, your movement will be halved to 15 feet while you're grappling anything Small or larger. Then each foot of movement costs an extra foot (or 2 in difficult terrain) while climbing. So, even if your DM rules that you can climb while grappling, you're only going to be able to climb 7.5 feet (or 5 in difficult terrain) while grappling anything but a Tiny creature.