At the beginning of my English studies, I was always perplexed by phrases like "It is me". Because if you translate directly the pronoun "me" into Russian, it corresponds to the form of the dative case, and the pronoun " I " to the form of the nominative case. In our language, these are different grammatical forms and "I" can never be replaced by "me", otherwise people will not understand you. In English there are no cases, but before they were. So I think there was a transformation of I - >me. From my point of view, the phrase "It is me" sounds more melodic than "It is I" and it is easier and faster to pronounce. That's the reason.
I used to say this phrase as "It is I" just translating it as a carbon copy from my native language, but after I heard in the movie "Liar, liar" the famous phrase "It was me!" then my opinion has changed :)