There are two reasons that Matthias HAS to be the 12th Apostle and they are rooted in Scripture.
a) Jesus came to reunite Israel. The Kingdom is (partially) restored during the Pentecost when Jews from all over the world were brought into a New Covenant. Just as in the Old Covenant, there were 12 judges, in the New Covenant, there would be 12 judges. Jesus says as much in Matthew (I believe).
Hence, during the Pentecost there had to be 12 Apostles. One thing to note is, Jesus could have selected the 12th Apostle at any time during his Resurrection and prior to His Ascension, but He left it up to the Church to decide. That is very, VERY important in my view.
b) The selection “by lot” is actually Scriptural, as well. The Jews used to use a similar technique, by rolling the Urin and the Thummim.
Proverbs 16:19 and Leviticus 16:8 describe this:
When the lot is cast into the lap, its decision depends entirely on the LORD.
***he shall cast lots to determine which one is for the LORD and which for Azazel.
And Exodus 28:30 describes the Urim and the Thumin used to cast the lots. This verse describes the High Priests’ garb::
In this breastpiece of decision you shall put the Urim and Thummim, that they may be over Aaron’s heart whenever he enters the presence of the LORD. Thus he shall always bear the decisions for the Israelites over his heart in the LORD’S presence.