The Latinate syntactical construction norms that moved over to English included, among many others, one around prepositions (from the Latin prae, meaning before) being placed before the object with which it is linked, never after.
It certainly isn't a rule, per se; and ending a sentence with a preposition is not wrong. But it is stylistically less desirable.
Dryden hated that Ben Jonson occasionally ended sentences with prepositions. He gave the norm added power and it has lasted, since his 1672 criticism, another 250 years. Dryden never said that ending a sentence with a preposition was wrong, only that it was ugly.