Ezekiel 18:8-14 is describing God's perfect law of justice, that each person who sins will pay the penalty of that sin, which is death. Nobody else will pay that penalty.
The context of this passage begins in the beginning of the chapter. In verses 2 and 3 we are told the proverb will no longer be said, "The fathers eat the sour grapes, but the children's teeth are set on edge." Here God shows that there is a principle which had been in effect throughout history, specifically that people inherited their father's sin and its effects. This is shown even more clearly in Exodus 34:6,7, where God declares His righteousness to Moses. God tells of His compassion and lovingkindness, and His forgiveness. Yet He then concludes that the punishment for the guilty would be to the third and fourth generations. On a grander scale, 1 Corinthians 15:22 tells us that “in Adam all die.” Adam's children have been dying ever since Adam sinned. This scripture also tells us that “in Christ all shall be made alive.” Just as we are all under the death penalty for Adam's sin, we will all be released from that penalty through Jesus’s sacrifice.
Back in Ezekiel 18:3, it shows that there will be a future time where this principle will change. From verse 4 until verse 32 God explains that each individual will be judged according to whether they themselves were obedient and faithful to God. As was shown in Exodus 34, this is not the case now. When will things change?
This change is explained more fully in Jeremiah 31:27-34, where Jeremiah again quotes this proverb, saying “In those days they will not say again, ‘The fathers have eaten sour grapes, and the children's teeth are set on edge.’ But everyone will die for his own iniquity; each man who eats the sour grapes, his teeth will be set on edge.” Jeremiah continues to explain that this is in the future. God says He will write His law on the hearts of the people; all will know the Lord; and He will “forgive their iniquity, and their sin I will remember no more.” Jeremiah is describing God’s Kingdom when His perfect Law of justice will be in effect. At that time, people will be free from the penalty of Adam’s sin, will be restored to full fellowship with God and be capable of living up to the requirements of that Law. God’s law will be written on their hearts, and they will have learned to love that law and want to live up to it.