The immediate reason is not a general principle of English grammar, but the particular requirements of the verb ban.
Ban has two subcategorisation frames:
They banned smoking
They banned him from smoking
But *They banned [him] to smoke is not grammatical, whether the 'him' is there or not.
Other words have their own patterns, which are similar in some ways, different in others:
They allow smoking.
They allow him to smoke.
*They allow to smoke.
So in this case, the infinitive is permitted, but not as the direct object: there must be a direct object (a person).
So the answer to your question is that "To smoke is banned" is not grammatical, because ban does not allow an infinitive as its direct object.
One further point: when a verb does accept an infinitive as its direct object, it always seems to mean the specific case of the speaker. So I want to smoke means that I want me to smoke (though we almost never express the me). Not many verbs seem to accept either an infinitive or an -ing, but one that does is expect, and there you can see the difference in meaning:
I expect to smoke.
means that I expect that I shall smoke, while
I expect smoking.
means that I expect that people will be smoking, not necessarily me.