> Contrast it is necessary that you ... with its Latin equivalent oportet tibi, meaning more or less 'necessitates for you'. Since subject pronouns are not used in Latin except for emphasis, neither are expletive pronouns and the problem does not arise.
Whether or not it is a pronoun here (and linguists today would say that it is one), English is not Latin; and the sentence was and is fully acceptable to native speakers of English and thus was and is grammatical. It has no meaning here; it merely serves as a dummy subject.