Why did Judas get replaced by Matthias?

Why did Judas get replaced by Matthias? 

After Judas Iscariot died, the remaining Apostles made the decision to replace him, and to continue the mission that was given to Judas to spread the good news of Christ to all nations. When making the decision of a replacement, Peter said it had to be someone who had accompanied Jesus from his baptism to his Ascension (Acts 1: 21-23). They proposed two candidates who met the requirements: Joseph called Barsabbas and Matthias. 

They prayed for the Lord to show them which of the two he had chosen for the mission, and they cast lots for the two men; the lot fell on Matthias and he became the twelfth Apostle.