Huck justifies stealing vs. borrowing as he mulls over Tom's words in Chapter 35. It is all stealing, Huck realizes, but sometimes the theft is justified when need, not greed, is the motivation.
Here is Huck's internal dialogue from Chapter 35.
Along during the morning I borrowed a sheet and a white shirt off of the clothes-line; and I found an old sack and put them in it, and we went down and got the fox-fire, and put that in too. I called it borrowing, because that was what pap always called it; but Tom said it warn't borrowing, it was stealing. He said we was representing prisoners; and prisoners don't care how they get a thing so they get it, and nobody don't blame them for it, either. It ain't no crime in a prisoner to steal the thing he needs to get away with, Tom said; it's his right; and so, as long as we was representing a prisoner, we had a perfect right to steal anything on this place we had the least use for to get ourselves out of prison with. He said if we warn't prisoners it would be a very different thing, and nobody but a mean, ornery person would steal when he warn't a prisoner. So we allowed we would steal everything there was that come handy. And yet he made a mighty fuss, one day, after that, when I stole a watermelon out of the nigger-patch and eat it; and he made me go and give the niggers a dime without telling them what it was for. Tom said that what he meant was, we could steal anything we NEEDED. Well, I says, I needed the watermelon. But he said I didn't need it to get out of prison with; there's where the difference was. He said if I'd a wanted it to hide a knife in, and smuggle it to Jim to kill the seneskal with, it would a been all right. So I let it go at that, though I couldn't see no advantage in my representing a prisoner if I got to set down and chaw over a lot of gold-leaf distinctions like that every time I see a chance to hog a watermelon.