That rule works pretty well, but I think it's an accident of circumstances. For a preposition that introduces a prepositional phrase, a nominal object has to follow the preposition. Not a verb. So if you need to say something that requires a verb after a preposition, you have to convert the verb into a noun. Or rather, putting it more carefully, you have to nominalize the sentence that the verb occurs in. The only ways to do that in English that retain the verbal status of the verb are to use the "Poss-ing" complementizer or the "for-to" complementizer. Ignoring what happens to the subject of the sentence complement, that comes down to either adding "-ing" to the end of the verb or putting infinitival "to" in front of the verb.
So, here's an example of what happens. The verb "decide" takes a following prepositional phrase complement to specify what is decided: "I decided on it". If "it" is an action describing me buying a purple shirt, I could say A. "I decided that I would buy a purple shirt", B. "I decided to buy a purple shirt", C. "I decided on the purchase of a purple shirt", D. "I decided on buying a purple shirt".
Notice that the "on" is lost in versions A and B, and the verb "buy" has been converted to a noun in C. The only ways to fit a sentence into the structure demanded by "decide on" and at the same time keep the verb "buy" present are in B and D, and those have "to" before the verb or "-ing" added to the end of the verb.
So all the possible exceptions to your rule of thumb have been eliminated, more or less by coincidence.
(I didn't realize this was going to be so involved when I started typing it out.)