God made the pattern happen. The real question to be asked is WHY were the three deleted?
If you read your Bible, the reason these three were deleted was a direct result of God's annoiting Jehu to totally destroy the house of Ahab to a fare thee well. Ahab was an evil king on the Israel side who was married to Jezebel. Ahab's "house" crossed over the bounds of the two kingdoms into Judah by way of marriage ties. God's destruction is complete when he commands it.
Ahabs "house" was ended, four generations (Israel side) and for three generations (Judah side, those missing names in Matthew). (Please note 4+3=7). Here is God's LAW because of the sinful evildoing and Baal worship:
Ex 20:5
5 You shall not bow down to them or worship them; for I, the LORD your God, am a jealous God, punishing the children for the sin of the fathers to the third and fourth generation of those who hate me,
God upheld his LAW 100%. It was given and KNOWN by these sinful men. It was broken intentionally by these sinful men. Those guilty were punished.
Ahab's "house" totally ended. Jehu, who was NOT Ahab's offspring, became king of Israel. And as God punished the evildoers and Baal worshippers for 3 and 4 generations ON BOTH SIDES of the kingdoms respectively, Jehu was rewarded with God saying that four of his generations would rule over Israel for his obediance to YHWH, which indeed happened as recorded:
2 Kings 10:30-31
30 The LORD said to Jehu, "Because you have done well in accomplishing what is right in my eyes and have done to the house of Ahab all I had in mind to do, your descendants will sit on the throne of Israel to the fourth generation."
God has balanced scales. Generations punished ON BOTH SIDES equal to their sin, and Jehu is rewarded with four of the generations that were totally removed from Ahab.
What is also interesting, is BOTH kingdoms had a similar problem at the same time. Woman rulership. Jezebel on the Israel side and Athaliah (Ahaziah's mother) on the Judah side. Both very evil woman. God hated BOTH sides.
Now, regarding the "missing names" of Ahaziah, Joash and Amaziah in the book of Matthew, God did exactly what He said He would do upon His deciding it HOW to be done:
Ex 32:33
33 The LORD replied to Moses, "Whoever has sinned against me I will blot out of my book."
So, who REALLY blotted out the names??
The three names in Judah WERE IN TRUTH blotted out of God's book under YHWH's direction.
******************************************************************
Question: Are you not curious regarding the second half of the evil Lamech's cursed utterance?
Genesis 4:24 "If Cain is avenged seven times,
then Lamech seventy-seven times."
After seven "times," Cain's lineage was cut off.
What is this Avenger of 77? If the avenger of 7 times has a logical answer, surely the avenger of 77 must have an answer too? Right?
It does.