Work is done when a force acts on something that moves in the direction in which the force is acting (page 110). When the bob swings back and forth, the string tension stays perpendicular to the direction in which the bob is moving. There is no tension force component in the direction of motion; the work done by tension is zero. When the pendulum swings, the gravitational force does have a component parallel to (or opposite to) the direction of motion, except when the bob is at the very bottom. The work done by gravity serves to change the bob's KE.