The mention of the mamzer (traditionally, "bastard") in Devarim 23:3 is traditionally understood as the severe social stigmatization of a child born of an illicit sexual union. Such individuals are not allowed to marry native-born Jews up to ten generations of their descendants.
However, this would seem to be in contradiction to the words of Yehezqel 18:19-20ff which states that children will not be held responsible nor punished for the sins of their parents.
I have heard that some were of the opinion that the peshat of Dev. 23:3 was a reference to a nation and not illicitly conceived children. Were there any traditional commentators in any rabbinic era who held such a view?
And if not, how are we to reconcile these concepts?