"He may be me," said Father Brown, with cheerful contempt for grammar.—G K Chesterton, "The incredulity of Father Brown"
Here we have I as a subject complement, which is a noun phrase which follows a linking verb. Linking verbs describe or rename the subject, rather than describing an action that happens upon it. (A good guide is if you replaced the verb with
= would it still make logical sense, allowing for tense and number).
Hence what we may call the "strict" grammatical argument would say that in "...you were [first-person pronoun]", the first person pronoun is a subject, not an object, and hence should be I, not me.
But like Father Brown we may also, with cheerful contempt for such ideas, treat it as a direct object, and hence have me rather than I.
More to the point, treating the noun phrase here as the direct object (saying "It is me" rather than "It is I") is well-established, and accepted by many, to the point where the "strict" approach may seem stuffy to many and wrong to some.
But it is by the "strict" approach, that these particular lyrics are indeed grammatically correct.
More important though, is that grammar is a means to an end.
The end is the transfer of ideas, emotions and opinions from one mind to another as fully and successfully as possible.
Following the well-attested rules helps us do that. Sometimes following the zombie rules that some people here (and I am one of them) will argue against, will still help us do that. Often breaking the zombie rules will do that. Every now and then, breaking even the well-attested rules will help us do that. This last falls into the category of "poetic license".
As such, in song lyrics, I would perhaps support "you were I" even if it were not strictly grammatical, if they were used to good effect. (But only if they were).
Still, that's moot in this case, and moot it mote be,* for they are indeed grammatical.
*"Moot it mote be" is horrible, isn't it? That's what happens if you follow the letter of the rules, and nothing else.