There are two ways to use the word to: As a preposition and as infinitive.
When it's used as a preposition, it takes -ING, which is the case of many verbs that can only be proceeded by to as a preposition:
I'm addicted to doing it
He is allergic to helping my friends
They are used to playing in evenings
These examples mentioned above have to acting as a preposition, not as an infinitive.
These are one of the verbs that can only be proceeded by to as a preposition. How to identify when to use to as a preposition? I'm afraid there is no way to identify it, all you can do is memorize all verbs that are proceeded by to as preposition, and some of them I have already mentioned above.
One typical expression followed by to as preposition:
I'm looking forward to seeing you.
I'm looking forward to hearing from you.
We are looking forward to meeting you.
Here is one list of verbs that will always take to as a preposition: Verbs followed by gerund