I am not able to understand why the infinitive must be used after "I am qualified to".
I am qualified to teach.
Does not to play the role of preposition in this sentence?
If the question above is true, should not a gerund be used?
Because that is the way English is.
I'm sorry, but that is the whole of the answer.
You can discuss the historical development, compare different constructions, but there is no known way of predicting which of the possible constructions happen to be grammatical at the present stage of the English language.
Why would "qualified" take the infinitive? First of all, it isn't the only word to do so. Some verbs "take" the infinitive. That's the way it is. And English isn't alone when it comes to certain verbs "taking" the infinitive.
I suggest you read the article on "Infinitive" on Wikipedia, especially the section on "infinitive phrases and clauses". It might be instructive.