Herman Melville was required to take on many mundane jobs, as his career as an author failed to ever launch him into much success during his lifetime. The character of Bartleby, however, does more than represent a working-class everyman. Bartleby reflects Melville's deeper spiritual issues regarding the value of work and life. While the other characters in Bartleby the Scrivener accept their lot in life, Bartleby does not. The simple expression "I prefer not to" reflects a denial of any activity that simply preoccupies one in life as they await death.
Melville struggled with what many, and probably Melville himself, would see as a nihilistic perspective on existence. The character of the lawyer acts as a conscience to this dire point of view presented by Bartleby. Possibly, this is Melville's argument against these leanings in his own personal outlook. For the lawyer puts up with Bartleby at every turn as if dealing with an undesirable part of himself.
In the end, the final cry from the lawyer at Bartleby's death is "Ah humanity!" Melville expresses this unresolved conflict in himself and the world between plodding through existence or denying it.