The psalmist prayed that God would do several specific things to avenge him. He asked God to return what his enemy was doing to him back on himself. He wanted a wicked man to oppose and accuse him. He wanted God to judge his enemy guilty and put him to death. He also asked that God punish his wife and children for his wickedness. In the future he hoped no one would remember him and that he would have no descendants. Having one"s family name terminated was considered to be a great tragedy in the ancient Near East. [1][source]
It seems inappropriate for David to ask God to punish children for the sins of their fathers, since God specifically forbade this in the Mosaic Law (cf. Deuteronomy 26:12-14). Perhaps David prayed contrary to God"s will, allowing his hatred to get the better of him. Even though the Bible records many things that it does not condone, there is nothing in this text that would suggest that David was not praying in the will of God. Another explanation is that he was praying in hyperbole. In other words, he did not really mean what he was saying but used extreme language to communicate his strong feelings. However, he did not just make one statement about his enemy"s wife and children but developed this desire in considerable detail. This seems to indicate that he meant what he said. I think the best explanation is that David"s concern in these requests was his enemy rather than his enemy"s wife and children. He said what he did as a punishment on his enemy, not because his hatred of his enemy extended to his wife and children. David seems to have been anticipating various consequences that his enemy would experience because of God"s judgment. [2][source]
"One might think the punishment should be confined to the individual and that his family should not have to suffer for his crimes. However, in ancient Semitic thought a man and his offspring were inseparably bound together so that the actions of the former could influence the destiny of the latter. Of course, one sees this principle at work in the world every day and, not surprisingly, it permeates the Bible as well." [3][source]