The first time we read about the town as a character in The Pearl is at the beginning of chapter three, when John Steinbeck personifies the town as a kind of animal. He is not subtle about the imagery, and he begins the description with a clear simile:
A town is a thing like a colonial animal. A town has a nervous system and a head and shoulders and feet. A town is a thing separate from all other towns, so that there are no two towns alike. And a town has a whole emotion. How news travels through a town is a mystery not easily to be solved. News seems to move faster than small boys can scramble and dart to tell it, faster than women can call it over the fences.
This town, according to the author, is alive and has the capacity to think, move, and communicate. In fact, it even has emotions and, when there is news to tell, the town is able to communicate it even more quickly than gossiping humans can.
When Kino brings his great pearl to town, Steinbeck says "the nerves of the town were pulsing and vibrating with the news," and soon everyone in the town is doing the same.
Unfortunately, the creature (the town) turns "black and evil" when it gets greedy and selfish, and
[t]he poison sacs of the town began to manufacture venom, and the town swelled and puffed with the pressure of it.
It is clear that the author has given the town animal characteristics, and that is consistent with the imagery in the chapters after Kino is unwilling to sell his pearl to the dishonest pearl buyers in town (which happens in chapter four). Steinbeck is personifying the greed and selfishness of the townspeople by turning them into a self-serving, greedy, poisonous animal; we know this is true because the same thing happens to Kino and Juana when they grow greedy.
When Juana steals the pearl and tries to sneak away and Kino finds her, the author describes them in purely animalistic terms.
Kino looked down at her and his teeth were bared. He hissed at her like a snake, and Juana stared at him with wide unfrightened eyes, like a sheep before the butcher.
The city is the biggest, deadliest most poisonous character in the story because of its greed and selfishness; when Juana and Kino demonstrate these qualities, they become figurative animals, as well.