My guess is that "Matěj" and "František" are being used because one (Matěj) ends in a soft consonant, and the other (František) ends in a hard consonant.
As you're already discovering (possibly to your dismay), endings change... a LOT. And they often change based on the last letter of the word to which they're being attached. So we're sort of learning two declension paradigms for male names (without even realizing it) for the price of one! :-)