Answer :

Huck stole the money from the mattress because he didn't want the King and the Duke to have it, since they stole it from the girls. He takes the money and he hides it in the coffin of Peter Wilks.