In the novel, racism is used to demonstrate a main theme: how a biased worldview can distort reality in one's mind.
The story is narrated by Charlie Fox but dominated by Allie "Father" Fox, a scientist and iconoclast who despises what America has become. Allie is sick of commercialism, pornographic entertainment, cheap imported goods, and society's obsession with technology. However, he is also a racist, xenophobe, and misanthrope. This is a man who calls Central American immigrants "savages." In short, Allie loathes America and wants to leave it altogether. He believes that his family needs to reject civilization and return to living off the land. So, he moves his entire family (a wife and four children) to Honduras.
There, he buys the deed to Jeronimo, a remote town on the coast of La Cieba. More than anything, Allie wants to prove a point. He thinks that he can make Honduras a better place to live and that he can save the native "savages" from a life of continued degradation.
However, Allie's altruism is subsumed by his inherently racist and biased worldview. Throughout the novel, Charlie gives us an account of his father's genius. Allie is a world-class inventor who wastes little time in modernizing Jeronimo. Ironically, despite his hatred of all the accoutrements that come with civilization, he revels in his prized inventions: the Fat Boy, the Self-Sealing Tank, and the Metal Muscle.
In the novel, the author shows that Allie's supposed altruism is actually motivated by his inherent racism. As the novel progresses, his sanctimonious attitude leads him to the edge of megalomania:
Father went on to say that savagery was seeing and not believing you could do it yourself and that was a fearful condition. The man who saw a bird and made it into a god, because he could not imagine flying himself, was a savage of the most basic kind. There were tribes of people who did not have the sense to build huts. They went around naked and caught double-pneumonia. And yet, they lived in the same neighborhood as birds that made nests and jackrabbits that dug holes. So, these people were savages of utter worthlessness who did not have the imagination to come in out of the rain.
Allie thinks that much of civilization is beneath him and his genius. His racist, xenophobic, and misanthropic attitudes originate from his contempt for his fellow human beings. The natives, the Zambus, are fascinated by Allie's ways and his inventions. They work for him and hang on his every word. However, they little comprehend the level of contempt Allie has for them:
This was different from Father's way. He was an innovator. He thought nothing of getting a dozen people to peel wood or dig ditches, and he would not tell them why until he had finished. Then, he would say, "You've just made yourself a permanent enhancement!" Or he would ask them to guess what a particular thing was for (no one so far had guessed what Fat Boy was for), and laugh when they gave him the wrong answer.
Allie's misplaced feelings of superiority eventually lead him to embrace an alternate reality. He comes to believe that he is the "last man left" in America. In Allie's mind, he is the only one who can save America and the rest of civilization. Therefore, he must be the only worthy living thing on earth. Near the end of the novel, Allie's mind continues to unravel. He declares America destroyed and non-existent. In the end, Allie dies a broken, confused, and disillusioned man. So, the author uses racism to highlight how a biased worldview can distort reality in one's mind.