A powerful lord in Lear's court, Gloucester is part of Lear's generation – one of the old guards. In the power struggle that follows Lear's retirement, this pits Gloucester against the younger generation: Lear's elder daughters and their husbands.
Gloucester's blinding in the play makes literal his emotional blindness towards his two sons, Edgar and Edmund. Only when he becomes blind does Gloucester gain true insight into who his children really are – and which of them actually loves him.
This makes Gloucester a foil for Lear both personally and politically. Gloucester and Lear both reject a child who truly loves them in favor of children who suck up to them. Metaphorically, both Gloucester and Lear are blind to both of their respective "good" children, Edgar and Cordelia, and the wickedness of their "bad" children, Edmund, Goneril, and Regan.
Politically, both Gloucester and Lear find themselves pushed out of their positions by a younger generation eager to assume power. Regan and Goneril lock their father, Lear, out of the house during a storm. When Gloucester tries to help Lear, Regan and her husband Cornwall, punish Gloucester by stripping him of his political office, blinding him, and finally throwing him out of the castle to wander around helplessly.
Gloucester's experiences highlight the play's focus on what happens when power shifts from one generation to another. After he is blinded, one of Gloucester's old servants kindly guides him out of the palace. Despite his sudden fall from influence, Gloucester's attitude demonstrates that it's hard for someone who's always been on top to adjust to life as someone without power. "Do as I bid thee," he orders the servant who is helping him.
Then, suddenly realizing his position, Gloucester adds, "Or rather, do thy pleasure" (4.1.50). After a lifetime of being in command, Gloucester finally has to learn how to say please. His slow transition from having an arrogant attitude to one of consideration for others mirrors Lear's journey through the play and reinforces the play's message that deeper wisdom is earned through suffering.
This transformation is necessary, because the Gloucester we meet at the beginning of the play is self-satisfied and a little hypocritical. Gloucester's weakness is women, and one of his extramarital affairs produced Edmund. Some people, including Edgar, argue that Gloucester getting blinded is payback for the sin of adultery. It's also noteworthy that Gloucester talks dirty about Edmund's mother right in front of his son – proving that he is insensitive at best.
Then Gloucester goes on to believe Edmund's story about Edgar betraying him. He doesn't even try to speak with his other son before he assumes that what Edmund says is true. Whatever happened to faith? Trust? Finally, Gloucester seems to recognize neither Kent (who was his colleague) nor his own son, Edgar, when those men are in disguise. The icing on the cake is that Gloucester is a jerk to the homeless man that is really his long-suffering son. Obviously, Gloucester pays way too much attention to outer appearance and social position, and that blinds him from seeing what really matters.