Dave feels that others don't respect him and look down on him because he is young, poor, and has not yet made his place in the world. He has a job, but his parents keep his wages. He feels put down because of this. His parents appear quite strict and he is awkward in his interactions with them.
Dave feels he can earn respect if he gets himself a gun. Indeed, he appears quite obsessed with the idea of buying one. When he finally does so, he is simply awed by it:
In the grey light of dawn he held it loosely, feeling a sense of power. Could kill a man with this. Kill anyobdy, black or white. And if he were holding his gun in his hand, nobody could run over him; they would have to respect him.
To Dave, then, the gun becomes a symbol of his manhood. It endows him with a sense of importance which he has hitherto lacked. As a disaffected black youth, he feels as though the gun empowers him; it will allow him to dominate others, not just of his own race but whites as well.
Of course, this is really only a kind of romantic fantasizing on Dave's part; in the event, he accidentally kills someone's mule, desperately attempts to cover it up and is publicly humiliated when found out. However, he tenaciously holds on to the gun, refusing to give it up as his parents demand. Indeed, rather than give the gun up, he renounces his old life by fleeing on a midnight train, with the gun still securely in his possession. He thinks that he can earn respect elsewhere - although as he is young and alone and without any prospects, this is really continued wishful thinking on his part.