@Uthred Yes, it's a cultural thing but its not just limited to the chinese. lots of cultures around the world have historically had punishments where the families of the criminal were also punished for the criminals crime. (for ex also seen in korean, vietnam, and japanese cultures to some lesser extent)
There's a Chinese phrase" 滿門抄斬、株連九族" or "nine familial extermination/execution of nine relations" which refers to the most serious serious punishment for a capital offense in Ancient China. Often for serious crimes like treason/rebellion, this punishment involved the execution of all relatives of an individual, which were categorized into 9 groups in ancient china. So This would be the criminal's parents, grandparents, uncles and aunts + their spouses and family, cousins + spouses and family , spouse + spouse's family, and any children + their spouse and family.
obviously this isn't really practiced in the modern world but you can see why chinese authors love to incorporate this kind of thing into their fiction.