Thoreau compares the government to a machine to explain how governments dehumanize individuals. Thoreau claims that the "mass of men" serve the state as machines "with their bodies"; they "put themselves on a level with wood and earth and stones." What he means is that by serving the state, people do what the state tells them to do rather than what their conscience dictates. They become less than human because they allow the needs of the state to supersede their own individual morality.
Thoreau specifically criticizes the "American government" on two issues: slavery and the Mexican War. These two issues show that the government is a machine which produces inequality, hatred, and bloodshed. Individuals are acted upon by the superior physical strength of the machine/state and through coercion are forced to become complicit in its actions. In such a case, Thoreau says individuals should intervene in the functioning of the machine—"Let your life be a counter friction to stop the machine." More plainly, he says that in such cases where the law is unjust, we are morally obligated to break the law.
Thoreau's valorization of the individual conscience is an expression of his love of personal freedom, something that is achieved only by resisting the machine. The famous example he gives in this essay is his night spent in jail for failing to pay taxes. Being locked up is ironically a way of becoming free; he bonds with his cellmate and derives personal satisfaction from opting out in this small way from participating in the "machine" of the state.