Hanging from the balls is a vulgar, popular expression with which someone desires or manifests a bad punch to a male human being for his actions. It is a metaphor or eupheistic expression. Balls is metaphor, by similarity, with the testicles of males. So its real meaning is to hang, by rope or cable, someone by their parts, rather than by the neck. It underlines the fact of his evil, by making him dependent on cause and effect : being hung from his sex, he denotes that this was his sin. The saying is fulfilled : In sin, he carries penance.
It is an ordinary phrase that has some variants in its meaning. In principle 'balls' are "the testicles", and when a male has to maintain or endure something or someone can say that "hangs him from the balls" as reinforcing the idea of heaviness, effort and pain for that unpleasant situation. There is a version used among media, people with some fame, where anyone looking for renown hangs up to figure, to make themselves look close to someone popular; and in this case the same phrase is also used. In a woman there is "hanging of tits". The other known meaning stems from lynching, and 'hanging from balls' would be a form of punishment, or suicide. As a euphemism of the latter is used "hanging from the lashes".