What people want to believe themselves (or what they want to believe the scriptures say) and then what the scriptures themselves do say are usually two different things. That said, from a purely historical perspective, there does seem to be an evolution of thought within the history of the Hebrew Bible itself.
For example, acc. to the Mosaic Law (in a dramatic date perspective, prior to David) David should have taken vengeance sometimes but did not. Indeed, he should have been stoned himself for arranging Uriah's death, but he was not. So the contradiction between Ex. 20 and Deut. 18 that you point out can be easily conceived of—again from a purely historical perspective—as simply an evolution of religious thinking within the Hebrew/Israelite/Jewish faith, that is, "our ancestors used to believe that our God Jehovah takes vengeance for the sins of fathers upon sons. But we Jews [by the date of Ezekiel] now know that isn't how God operates. Each person is individually responsible for his/her own actions."
That's a nice tidy explanation, but then we encounter in the NT, which is supposed to be more loving and tolerant than the OT, Matthew's report that the Jews responsible for wanting Jesus dead exclaim, "Let his blood come upon us and our children" (27:25), clearly a return to the spirit of Ex. 20.
Go figure! If we want any sort of crystal clear theology rooted the Bible, we're dreaming. It's generally pretty murky stuff, full of contradictions or at least what look like such on the surface. Enter the theologians.