And how did a culture governed by Confucian morals justify it and what purpose was it seen to serve?
There is a historical Chinese punishment called 株连九族 (lit. punishment of the nine relations) which was the execution of oneself, their parents, their grandparents, their children, their grandchildren, their brothers/sisters, their uncles and aunts. There was also one guy, Fang Xiarou, who demanded punishment of 10 relations to make a statement, so his students and followers were also executed.
The idea was that as the guilty party committed some sort of offense, that the rest of the family (the Confucian relations) were also guilty, and thus should be punished accordingly. One of the key relationships in Confucianism is that of the subject and the lord. A subject breaking this relationship should thus be punished.