We have to read the entire chapter to get the context. Other passages witness to it as well.
Ezekiel 18:1 The word of the LORD came unto me again, saying,
Ezekiel 18:2 What mean ye, that ye use this proverb concerning the land of Israel, saying, The fathers have eaten sour grapes, and the children's teeth are set on edge?
Ezekiel 18:3 As I live, saith the Lord GOD, ye shall not have occasion any more to use this proverb in Israel.
Ezekiel 18:4 Behold, all souls are mine; as the soul of the father, so also the soul of the son is mine: the soul that sinneth, it shall die.
Ezekiel 18:5 But if a man be just, and do that which is lawful and right,
Ezekiel 18:6 And hath not eaten upon the mountains, neither hath lifted up his eyes to the idols of the house of Israel, neither hath defiled his neighbour's wife, neither hath come near to a menstruous woman,
Ezekiel 18:7 And hath not oppressed any, but hath restored to the debtor his pledge, hath spoiled none by violence, hath given his bread to the hungry, and hath covered the naked with a garment;
Ezekiel 18:8 He that hath not given forth upon usury, neither hath taken any increase, that hath withdrawn his hand from iniquity, hath executed true judgment between man and man,
Ezekiel 18:9 Hath walked in my statutes, and hath kept my judgments, to deal truly; he is just, he shall surely live, saith the Lord GOD.
Ezekiel 18:10 If he beget a son that is a robber, a shedder of blood, and that doeth the like to any one of these things,
Ezekiel 18:11 And that doeth not any of those duties, but even hath eaten upon the mountains, and defiled his neighbour's wife,
Ezekiel 18:12 Hath oppressed the poor and needy, hath spoiled by violence, hath not restored the pledge, and hath lifted up his eyes to the idols, hath committed abomination,
Ezekiel 18:13 Hath given forth upon usury, and hath taken increase: shall he then live? he shall not live: he hath done all these abominations; he shall surely die; his blood shall be upon him.
Ezekiel 18:14 Now, lo, if he beget a son, that seeth all his father's sins which he hath done, and considereth, and doeth not such like,
Ezekiel 18:15 That hath not eaten upon the mountains, neither hath lifted up his eyes to the idols of the house of Israel, hath not defiled his neighbour's wife,
Ezekiel 18:16 Neither hath oppressed any, hath not withholden the pledge, neither hath spoiled by violence, but hath given his bread to the hungry, and hath covered the naked with a garment,
Ezekiel 18:17 That hath taken off his hand from the poor, that hath not received usury nor increase, hath executed my judgments, hath walked in my statutes; he shall not die for the iniquity of his father, he shall surely live.
Ezekiel 18:18 As for his father, because he cruelly oppressed, spoiled his brother by violence, and did that which is not good among his people, lo, even he shall die in his iniquity.
Ezekiel 18:19 Yet say ye, Why? doth not the son bear the iniquity of the father? When the son hath done that which is lawful and right, and hath kept all my statutes, and hath done them, he shall surely live.
Ezekiel 18:20 The soul that sinneth, it shall die. The son shall not bear the iniquity of the father, neither shall the father bear the iniquity of the son: the righteousness of the righteous shall be upon him, and the wickedness of the wicked shall be upon him.
Ezekiel 18:21 But if the wicked will turn from all his sins that he hath committed, and keep all my statutes, and do that which is lawful and right, he shall surely live, he shall not die.
Ezekiel 18:22 All his transgressions that he hath committed, they shall not be mentioned unto him: in his righteousness that he hath done he shall live.
Ezekiel 18:23 Have I any pleasure at all that the wicked should die? saith the Lord GOD: and not that he should return from his ways, and live?
Ezekiel 18:24 But when the righteous turneth away from his righteousness, and committeth iniquity, and doeth according to all the abominations that the wicked man doeth, shall he live? All his righteousness that he hath done shall not be mentioned: in his trespass that he hath trespassed, and in his sin that he hath sinned, in them shall he die.
Ezekiel 18:25 Yet ye say, The way of the LORD is not equal. Hear now, O house of Israel; Is not my way equal? are not your ways unequal?
Ezekiel 18:26 When a righteous man turneth away from his righteousness, and committeth iniquity, and dieth in them; for his iniquity that he hath done shall he die.
Ezekiel 18:27 Again, when the wicked man turneth away from his wickedness that he hath committed, and doeth that which is lawful and right, he shall save his soul alive.
Ezekiel 18:28 Because he considereth, and turneth away from all his transgressions that he hath committed, he shall surely live, he shall not die.
Ezekiel 18:29 Yet saith the house of Israel, The way of the LORD is not equal. O house of Israel, are not my ways equal? are not your ways unequal?
Ezekiel 18:30 Therefore I will judge you, O house of Israel, every one according to his ways, saith the Lord GOD. Repent, and turn yourselves from all your transgressions; so iniquity shall not be your ruin.
Ezekiel 18:31 Cast away from you all your transgressions, whereby ye have transgressed; and make you a new heart and a new spirit: for why will ye die, O house of Israel?
Ezekiel 18:32 For I have no pleasure in the death of him that dieth, saith the Lord GOD: wherefore turn yourselves, and live ye.
The entire chapter explains it.
There are many examples in the scriptures of kings who lived wickedly. Some of the sons who preceded them did not do the same as their fathers, and some continued in those ways.
Ezekiel 18:31 Cast away from you all your transgressions, whereby ye have transgressed; and make you a new heart and a new spirit: for why will ye die, O house of Israel?
Jeremiah 31:30 But every one shall die for his own iniquity: every man that eateth the sour grape, his teeth shall be set on edge.
Jeremiah 31:31 Behold, the days come, saith the LORD, that I will make a new covenant with the house of Israel, and with the house of Judah:
Jeremiah 31:32 Not according to the covenant that I made with their fathers in the day that I took them by the hand to bring them out of the land of Egypt; which my covenant they brake, although I was an husband unto them, saith the LORD:
Jeremiah 31:33 But this shall be the covenant that I will make with the house of Israel; After those days, saith the LORD, I will put my law in their inward parts, and write it in their hearts; and will be their God, and they shall be my people.
Hebrews 10:16 This is the covenant that I will make with them after those days, saith the Lord, I will put my laws into their hearts, and in their minds will I write them;
Hebrews 10:17 And their sins and iniquities will I remember no more.
Romans 2:12 For as many as have sinned without law shall also perish without law: and as many as have sinned in the law shall be judged by the law;
Romans 2:13 (For not the hearers of the law are just before God, but the doers of the law shall be justified.
Romans 2:14 For when the Gentiles, which have not the law, do by nature the things contained in the law, these, having not the law, are a law unto themselves:
Romans 2:15 Which shew the work of the law written in their hearts, their conscience also bearing witness, and their thoughts the mean while accusing or else excusing one another;
Romans 2:16 In the day when God shall judge the secrets of men by Jesus Christ according to my gospel.
Romans 2:17 Behold, thou art called a Jew, and restest in the law, and makest thy boast of God,
Romans 2:18 And knowest his will, and approvest the things that are more excellent, being instructed out of the law;
Romans 2:19 And art confident that thou thyself art a guide of the blind, a light of them which are in darkness,
Romans 2:20 An instructor of the foolish, a teacher of babes, which hast the form of knowledge and of the truth in the law.
Romans 2:21 Thou therefore which teachest another, teachest thou not thyself? thou that preachest a man should not steal, dost thou steal?
Romans 2:22 Thou that sayest a man should not commit adultery, dost thou commit adultery? thou that abhorrest idols, dost thou commit sacrilege?
Quoting Grandpa: