Because your grade-school English teacher corrected two mistakes at once.
You’d say something like the first three words in this Jump Start comic by Robb Armstrong:
The first “mistake” is putting yourself first when you mention yourself and someone else. Putting yourself first is perfectly grammatical; doing so isn’t humble, though. In our culture, we think mentioning yourself last is more polite, but I have seen scientific writing in which the team leader put himself first. Something like “I and my colleagues performed a series of experiments,” which makes sense if the colleagues were only helping out.
The second mistake is a real one, using “me” as the subject. If you hadn’t happened to mention that other person, you wouldn’t have gotten it wrong—no ones says “Me went to the store.” Well, unless they’re being deliberately funny.
The problem is that correcting two things at once is a bit of overload for a young mind, so you don’t notice that you have a compound subject in the corrected sentence, and later when you mention your friend and yourself after a preposition, you follow the whole double correction and say something like “The teacher really gave it to Tim and I.”
I remember being in a car once with a bunch of students, and I happened to use “[someone] and me” after a preposition, and one of the students delightfully corrected me for saying “me.” I praised her for being alert, and explained my sentence with a short version of this post. I have no idea whether any of the occupants of the car changed their manner of speaking. Oh well.
PS—wouldn’t you know, I ran into this same mistake the same day I saw that Jump Start. This one is Rip Haywire. The mistake is in the middle of cell 5, though I think some of you can relate to the top row of cells…
…and here’s someone, The Norm, who made the “corrected” mistake. Cell 3: